如何将utf-8编码的简体中文字符串转化为繁体中文字符串?

如何将utf-8编码的简体中文字符串转化为繁体中文字符串
---------------------------------------------------------------

在C#里面进行简体<->繁体的转换也可以利用VB6中的StrConv函数。在使用之前需要在项目中添加Microsoft Visual Basic .NET Runtime的Reference,这样才能够使用Microsoft.VisualBasic下的各种函数。

下面是一段例子代码:
string str1="娱乐";
string str2=Microsoft.VisualBasic.Strings.StrConv(str1,Microsoft.VisualBasic.VbStrConv.TraditionalChinese,0);
MessageBox.Show(str2);
//str2 == "娛樂"

- 微软全球技术中心 acptvc

本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus