I'm populating a GridView with translations of a particular phrase in various languages obtained via web requests to Google Translate.
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 ---
精彩评论