我的翻译是充满了怪异的人物? [英] My translation is full of weird characters?

查看:122
本文介绍了我的翻译是充满了怪异的人物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我填充的 GridView控件在通过Web请求获得各种语言特定的短语翻译的谷歌翻译即可。

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

我已经在用 HttpUtility.HtmlDe code 来照顾特殊字符(如变音,重音),但什么是与钻石问号交易?

I already am using HttpUtility.HtmlDecode to take care of special characters (e.g. umlauts, accents), but what's the deal with the diamond question marks?

推荐答案

现在的问题是谷歌翻译,我相信 - 他们正在使用的不被.NET直接支持一种特殊的编码。当通过Web客户端/ WebRequest的结果在错误的下载,因为它不知道如何处理的编码做这是一个ISO编码和这些字符。

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.

我有同样的问题,我结束了使用他们的谷歌翻译的JSON API来获取干净的字符,则返回。

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

张贴在这里:
<一href=\"http://www.west-wind.com/weblog/posts/2011/Aug/06/Translating-with-Google-Translate-without-API-and-C-$c$c\" rel=\"nofollow\">http://www.west-wind.com/weblog/posts/2011/Aug/06/Translating-with-Google-Translate-without-API-and-C-$c$c

锄头这会有所帮助,

+++里克 -

这篇关于我的翻译是充满了怪异的人物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆