encoding

Convert const char* string to NSString with length AND encoding

I wonder which method would be better to convert const char* string to NSString. I found there are some facts. [NSString stringWithCString:length:] is kind of deprecated. [NSString stringWithCString:encoding] may be used for my purpose But I want to convert with length AND encoding(because I want to make that fine if I have some Non-...

Media encoding in JavaFX / SilverLight

I'm wondering if this is possible to be done either in JavaFX / SilverLight: Download an MPEG1 file from a remote server and then convert it to MPEG4 using the client's processing power (to reduce load from server)..I suppose this would be running as an applet on the browser, but my question is, can this be done using either of those te...

Encrypt printable text so result is still printable (can be typed)

I want to encrypt some info for a licensing system and I want the result to be able to be typed in by the user. Update: This operation must be reversible (decrypt-able) E.g., Encrypt ( ComputerID+ProductID) -> (any standard ASCII character that can be typed. Ideally maybe even just A-Z). So far what I did was to convert the encrypted t...

PHP Encoding with a Remote Key?

I have coded a pretty nice class and I'd like to install it on the clients server without risking them taking the code and not paying me. If possible, a method where I have the "key" on my server, and encrypt the source code on the clients server with that key and some how code the method for retrieving the key from my server into it, s...

PHP and Russian Letters

What is happening with Russian letters when sending via PHP request to ... a mail, by e.g.? the "hardcoded" russians letters are displayed properly, but from the Form's textboxex with hieroglyphs: HTML page: <tr> <td style="width: 280px">Содержание работ</td> <td><input type="text" id="workContent"/></td> </tr> PHP page: $WorkCont...

Encoding $_GET[] values with PHP to make them broswer safe

With PHP, which function is best to be used with $_GET[] values to make them browser safe? I have read up on a few htmlspecialchars() and htmlentities(). Should one of those be used or is there another function that would work better? ...

Sharepoint Designer stripping accent

I have an issue with Sharepoint Designer. Every time I put an accent in its HTML entities form: either &#233; or &eacute;, Sharepoint Designer changes it to é upon Check In and isn't shown when accessing the page on Internet Explorer. Is it an encoding problem? What can I do to avoid it? ...

Console output spits out Chinese(?) characters

This is a real shot in the dark, however maybe someone had a similar issue. Some console apps are being invoked by either SQL Server 2008, or Autosys (job schedule) under Windows Server 2008; output results of execution are being saved into .txt files. Every so often, with no definite pattern as far as I can tell saved output is display...

Working with UTF-8 instead of windows-1255

In the past, I used to work with windows-1255. Now my new page is written in UTF-8. When I send a query to DB (MS-Access), I get no results. The query on the URL shows the same like I type in by myself, but in this case (typing) I get results. How can it happen that I see the same URL on my IE and get the results and the other (that come...

Character encoding changes after window.open()

The site from where I'm calling the window.open() function is in UTF-8, using the <meta> tag, everything works well, but once I call the function and open another window with the same tag, the new window shows weird characters even thought in page info it shows that the encoding stays the same (UTF-8). This is the same problem as mine: ...

javascript ampersand (&) in return data will not show as value

Hi! I have this bit of code: ... var aData = request.responseXML.getElementsByTagName('data')[0]; var sDescription = aData.getElementsByTagName('description')[0].firstChild.data; alert(escape(sDescription)); document.getElementById('tempLabourLineDescription').value = sDescription; ... sDescription is outputting: SUPPORT ASSY-FUEL ...

How to know the encoding of a file in Python?

Hello Does anybody know how to get the encoding of a file in Python. I know that you can use the codecs module to open a file with a specific encoding but you have to know it in advance. import codecs f = codecs.open("file.txt", "r", "utf-8") Is there a way to detect automatically which encoding is used for a file? Thanks in advance...

Troubles with Unicode string encoding in Android

I get strings in different encodings (ID3 tags). I use e.g. new String( bytes, "UTF-16LE" ) to decode them. On my device (Motorola Milestone) and in the emulator, this works fine. But some users complained they get results like "T i t l e n a m e". I've tried the Sun codepage names instead (e.g. "UnicodeBigUnmarked"), with the same res...

Is encoding email links in unicode still useful ?

Many sites advise to encode email links in Unicode, to prevent robots from getting your contact email address. You get something like : <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#109;&#121;&#101;&#109;&#97;&#105;&#108;&#64;&#103;&#111;&#111;&#103;&#108;&#101;&#46;&#99;&#111;&#109;">&#109;&#121;&#101;&#109;&#97;&#105;&#108;&#64;...

Getting Swedish characters from a textbox control

Hello! I'm getting my text from a textbox from code-behind using control.Text() but I'm not getting the proper characters, I want "ÅÄÖ". Must be some problem with the text encoding but I've already checked my encoding settings in VS. Someone?? ...

redundant encoding?

This is more of a computer science / information theory question than a straightforward programming one, so if anyone knows of a better site to post this, please let me know. Let's say I have an N-bit piece of data that will be sent redundantly in M messages, where at least M-1 of those messages will be received successfully. I am inte...

redundant encoding of a sampled counter

this is an extension of my other question about redundant encoding, but the two are different enough that I wanted to split it up. What if I have a counter that increments once per tick, and at erratic rates a message will be sent out containing information about the counter. If I know that the interval between messages will be at most ...

NSString method to percent escape '&' for URL

Which NSString encoding method will percent escape the ampersand (&) character correctly into %26? stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding gets the spaces (%20) and other baddies but ignores ampersands!?! ...

String encoding of scandinavian letter from url to utf8 to const char on iphone

NSString *theString = @"a %C3%B8 b"; NSLog(@"%@", theString); NSString *utf8string = [theString stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding] NSLog(@"%@", utf8string); const char *theChar = [utf8string UTF8String]; NSLog(@"%s", theChar); This logs the following: 'a %C3%B8 b' 'a ø b' 'a √∏ b' The problem i...

Most compact way to encode a sequence of random variable length binary codes?

Let's say you have a List<List<Boolean>> and you want to encode that into binary form in the most compact way possible. I don't care about read or write performance. I just want to use the minimal amount of space. Also, the example is in Java, but we are not limited to the Java system. The length of each "List" is unbounded. Therefo...