asp.net - Wrong encoding when getting response from Google's translate API? -
i using google translate api translate text english german. code using is:
string url = string.format("http://www.google.com/translate_t?hl=en&ie=utf8&text={0}&langpair={1}", txtenglish.text, constants.languagepair); webclient webclient = new webclient(); webclient.encoding = system.text.encoding.utf8; webclient.downloadstringcompleted += new downloadstringcompletedeventhandler(texttranslation_downloadstringcompleted); webclient.downloadstringasync(new uri(url));
on receiving response in e.result
....... original text: can me?
translated german text on translator page: können sie mir helfen
result in e.result
: k�nnen sie mir helfen
so, plz me know why "�" special character coming , how can fix issue??
use fiddler check response headers , find encoding in there.
the way being shown unrelated data receive , related way representing in ui code. share , have look.
Comments
Post a Comment