none
Translation API - Unable to handle url encoding

    Question

  • Hi,

    I am working on IOS app that relies on MS translation api. I am successfully able to get the token and the translation seems to be working most of the times but when the text to be translated has <enter> / new line (\n), the translated text from the api is not accurate.

    Here is the query url(notice enter / newline has been replaced with %0A before hitting the api)

    https://api.microsofttranslator.com/V2/Ajax.svc/Translate?&text=1%0A2%0A3%0A4%0A5%0A%0A%0A&from=en&to=en

    However, the result from the api is:

    "1 2 3 4 5\u000a\u000a\u000a"

    (notice that the %0A between 1 and 2 are replaced by spaces and the %0A in the end has been replaced by \u000a.

    What am I doing wrong? I have been struggling on this issue for so long now.

    Sunday, June 5, 2016 7:57 AM

Answers

All replies