PDA

View Full Version : String encoding problems




jsnuff1
Jan 12, 2009, 10:51 PM
Im playing around with googles translate API on the phone but for certain translations, it dosent seem like the string encoding is working properly.

For example when i send in "How is the weather today" and translate it in french I get back

Comment est le temps aujourd\u0026#39;hui

this "\u0026#39;" is supposed to be an apostrophe so the above response should look like this

Comment est le temps aujourd'hui

Why is this happening? Im encoding the response data received as an NSUTF8 encoded string.

Should I be using a different encoding?


Thanks



caveman_uk
Jan 14, 2009, 02:56 AM
It looks like a Unicode string so you do need a different encoding.