String encoding problems

Discussion in 'iPhone/iPad Programming' started by jsnuff1, Jan 12, 2009.

  1. macrumors 6502

    Joined:
    Oct 4, 2003
    Location:
    NY
    #1
    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
     
  2. Guest

    caveman_uk

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

Share This Page