encoding

android: getting rid of "warning: unmappable character for encoding ascii"

I'm compiling using android tools without eclipse. I compile launching "ant debug" from command line. I have found many many instructions around the web about how to remove with annoying warning, but I haven't been able to make any of them work. I've tried -D option, I've tried randomly tweaking build.* files, I've tried exporting an ...

"Fix" String encoding in Java

I have a String created from a byte[] array, using UTF8 encoding. However, it should have been created using another encoding (windows-1252). Is there a way to convert this string back to the right encoding? I know it's easy to do if you have access to the original byte array, but it my case it's too late because it's given by a closed...

Convert Unicode char to closest (most similar) char in ASCII (.NET)

How do I to convert different Unicode characters to their closest ASCII equivalents? Like Ä -> A. I googled but didn't find any suitable solution. The trick Encoding.ASCII.GetBytes("Ä")[0] didn't work. (Result was ?). I found that there is a class Encoder that has a Fallback property that is exactly for cases when char can't be convert...

Convert French to ASCII (French speakers are wanted)

i need to convert French text to most correct analogue in ASCII. Let me explain. In German you should convert ä to ae, this is not simple removing of diacritics, it is finding most correct analogue. Please help me with French. I found that there is no programmatic way to do it, i create Dictionary<char, string>. To convert (+ capitals):...

Decoding not reversing unicode encoding in Django/Python

Ok, I have a hardcoded string I declare like this name = u"Par Catégorie" I have a # -- coding: utf-8 -- magic header, so I am guessing it's converted to utf-8 Down the road it's outputted to xml through xml_output.toprettyxml(indent='....', encoding='utf-8') And I get a UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3...

Why Read In UTF-16LE File Won't Convert "\r\n" Into "\n" In Windows

I am using Perl to read UTF-16LE files in Windows 7. If I read in an ASCII file with following code then each "\r\n" in file will be converted into a "\n" in memory: open CUR_FILE, "<", $asciiFile; If I read in an UTF-16LE(windows 1200) file with following code, this inconsistency cause problems when I trying to regexp lines with li...

How can i display image in IE using base64 encoding method?

Hi guys I want to display image using base64 encoding in IE using GWT If it is not possible can u please suggest me the alternate way except creating the image to serverside & sending URL to the client side Can u help me ? ...

How to keep character encoding with database queries.

Hi, I am doing the following. 1) I am exporting a database and saving it to a file called dump.sql. 2) The file is then transferred to a different server via PHP ftp. 3) When the file has been successfully transferred the administrator has an option to run a 'dbtransfer' script on the new host. 4) This script blows up the script and ru...

Convert .net String object into base64 encoded string

I have a question, which Unicode encoding to use while encoding .NET string into base64? I know strings are UTF-16 encoded on Windows, so is my way of encoding is the right one? public static String ToBase64String(this String source) { return Convert.ToBase64String(Encoding.Unicode.GetBytes(source)); } ...

Efficient JSON encoding for data that may be binary, but is often text

I need to send a JSON packet across the wire with the contents of an arbitrary file. This may be a binary file (like a ZIP file), but most often it will be plain ASCII text. I'm currently using base64 encoding, which handles all files, but it increases the size of the data significantly - even if the file is ASCII to begin with. Is ther...

Need MD5 guideline

Is there any specific algorithm for the encoding and decoding MD5. Kindly give me the proper direction or guideline, so that I can move on.. I have search a lot on Google but I haven't find, kindly give the articles or tutorial link. ...

C#: How to print a unicode string to console?

How do I print out the value of a unicode String in C# to the console? byte[] unicodeBytes = new byte[] {0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x70, 0x63, 0x61, 0x70}; string unicodeString = Encoding.Unicode.GetString(unicodeBytes); Console.WriteLine(unicodeString); What I get for t...

how to deal with a CP-1252 encoded password under linux?

Hi, I have the following problem. I need to create a zip file under linux with a password provided by another party that is encoded with CP-1252. What I have tried is changing the encoding of this password to UTF-8. Then I made a zipfile protected with this utf-8 encoded password. However the file can not be unzipped in windows with the...

Detect remote charset in php

Hello, I would like to determine a remote page's encoding through detection of the Content-Type header tag <meta http-equiv="Content-Type" content="text/html; charset=XXXXX" /> if present. I retrieve the remote page and try to do a regex to find the required setting if present. I am still learning hence the problem below... Here is ...

Text code decoding

Hello. I am an English/Spanish Spanish/English translator. I have been given a job where I have to translate Spanish text messages sent from cell phones. Some of them are in code. I assume each set of figures represents a letter. Is there any website where I can find information on how to decipher the code? For instance, the first messa...

How do I remove unrecognized characters which come back from a web service?

I am working on an app which calls a rest web service. Sometimes the xml responses contain characters which the phone can not display. When displaying these characters, an empty box is displayed instead. I would like to filter out these characters. How can I detect if a character will be able to be displayed on the screen? Some spec...

Convert PHP entities like &ndash; or &scaron; to their applicable characters

Hello, is there a way how to convert HTML entities to their applicable characters. Something similar to html_entity_decode()? I'm trying to make ordinary text without HTML entities from TinyMCE output. ...

Expression Encoder, Automatically start a live encoding session?

I configured my setting for live stream then save it to "test.xel" file. Can i open "test.xel" file from command - line? Can stream automatically start when "test.xel" file opens? Regards and thank you already now! ...

iphone's nsxmlparser parsing RSS causes encoding problems

Hi, Im working on simle RSS reader. This reader loads data from internet via this code: NSXMLParser *rss = [[NSXMLParser alloc] initWithURL:[NSURL URLWithString:@"http://twitter.com/statuses/user_timeline/50405236.rss"]]; My problem is with encoding. RSS 2.0 file is supposed to be UTF8 encoded according to encoding attribute in XML fi...

How to decode entities in Twitter statuses coming back from the search API, through JSON, in Java?

Twitter encodes some entities. They say at least < and >. They also say "When requesting XML, the response is UTF-8 encoded. Symbols and characters outside of the standard ASCII range may be translated to HTML entities." However it's unclear to me whether symbols outside ASCII range are encoded just if you request XML, or also th...