-2
我有這樣的代碼:如何將此字符串解碼爲utf-8字符串?
string URL = "http://translate.google.com/m?hl=vi&sl=en&tl=vi&ie=UTF-8&prev=_m&q=song";
string s = "";
WebClient client = new WebClient();
client.Headers.Add("user-agent", "Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1/21.0.025; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413");
s = client.DownloadString(URL);
在運行時我收到了字符串格式字符串:
danh tÆ°Ì€ buổi há»p để ca hát
這個字符串:
danh từ buổi họp để ca hát
非常感謝你:)
哪裏原從何而來?它編碼爲什麼? – Oded 2013-04-05 14:31:11
對。頁面的編碼是什麼,爲什麼你不把'client.Encoding'設置爲開始? – Oded 2013-04-05 14:37:37
@Oded:謝謝,它的工作,我是新手:) – Sakura 2013-04-05 14:39:41