String encoding problems

Discussion in 'iOS Programming' started by jsnuff1, Jan 12, 2009.

  1. jsnuff1 macrumors 6502a

    Oct 4, 2003
    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?

  2. caveman_uk Guest


    Feb 17, 2003
    Hitchin, Herts, UK
    It looks like a Unicode string so you do need a different encoding.

Share This Page