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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -