积极答复者
byte[] to string , 获取编码 System.Text.Encoding

问题
-
有一个byte[], 用PageCode = System.Text.Encoding.Default ,可以显示部分简体中文和繁体, 但有的却是乱码! 如果把 PageCode 改成 950 便可把之前的乱码问题解决! 但之前正确显示的文字却成了乱码! 我怎么判断这个 byte[] 在什么时候用 PageCode = 950或者 PageCode = System.Text.Encoding.Default ! 谢谢! 不知道如何下手,希望各位大哥帮帮忙! 急!!!!!!!
Vsto 学习中...- 已编辑 枫颖 2011年5月2日 9:35 语法错误
答案
-
你好,
参阅这篇博客:
http://hi.baidu.com/guodong828/blog/item/a64255a94ecad9f81e17a29c.html
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Paul Zhou 2011年5月11日 2:24
-
光有byte[]无法判断编码。你如果要检测编码的话,可以用IE的IMultiLanguage API,但是这个也不是百分之百正确。
你应该在获得数据的时候就获得编码。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 Paul Zhou 2011年5月11日 2:25
全部回复
-
你好,
参阅这篇博客:
http://hi.baidu.com/guodong828/blog/item/a64255a94ecad9f81e17a29c.html
Paul Zhou [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已标记为答案 Paul Zhou 2011年5月11日 2:24
-
光有byte[]无法判断编码。你如果要检测编码的话,可以用IE的IMultiLanguage API,但是这个也不是百分之百正确。
你应该在获得数据的时候就获得编码。
The following is signature, not part of post
Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
Visual C++ MVP- 已标记为答案 Paul Zhou 2011年5月11日 2:25