我需要将Shift-JIS编码[8140-EAA4]转换为对应的字符。
例如:
88A0 -> 唖
88A1 -> 娃
88A2 -> 阿
例如:
88A0 -> 唖
88A1 -> 娃
88A2 -> 阿
解决方案 »
- 菜鸟的问题:如何在运行程序时,把返回值传给label让其显示…
- C#:可试用的短信接口
- 求助c#调用DLL库出现的问题
- 路过有分:WinCE中的Winform窗体在设计时出现的怪问题
- 一个winform的UI问题
- vs 2005 智能设备中 ListView 控件如何取值
- datagrid 在重载时突然不见了,这是怎么回事?各位老大帮忙解决下,没分了,帮个忙,谢谢
- C#datagrid的更新问题
- C#如何实现FTP程序客户端向服务器传类型的任何文件????
- 新手请求帮助:如何获得系统日期?
- DataGridView中的问题,请高手指点问题所在
- 用户控件问题,我实在解决不了了,高手闷帮帮忙吧!!!
用gedit!
打开中文文件,然后save as,在对话框里选Character Coding里面的Add or Remove,再选shift_jis编码,存盘,就行了。
string s = "88A0";
byte[] bytes = new byte[s.Length / 2];
for (int i = 0, j = 0; i < s.Length; i += 4, j += 2)
{
bytes[j] = Convert.ToByte(s.Substring(i, 2), 16);
bytes[j + 1] = Convert.ToByte(s.Substring(i + 2, 2), 16);
}
string temp = encoding.GetString(bytes);
char[] c = new char[1];
decoder.GetChars(new byte[] { 0x88, 0xA1 }, 0, 2, c, 0);
Console.WriteLine(c[0]);