开发者

My translation is full of weird characters?

I'm populating a GridView with translations of a particular phrase in various languages obtained via web requests to Google Translate.

My translation is full of weird characters?

I already am using HttpUtility.HtmlDecode to take care of special characters (e.g. umlauts, accents), but what's the deal with the diamond quest开发者_C百科ion marks?


The problem is Google Translate I believe - they're using a special encoding that isn't supported directly by .NET. It's an ISO encoding and those characters when downloaded via WebClient/WebRequest result in errors because it doesn't know what to do with the encoding.

I had the same issue and I ended up using their Google Translate's JSON API to get clean characters returned.

Post here: http://www.west-wind.com/weblog/posts/2011/Aug/06/Translating-with-Google-Translate-without-API-and-C-Code

Hoe this helps,

+++ Rick ---

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜