最近做xna 的小程序需要显示中文;所以写了段生成GBK汉字的文本文件。
代码如下:
代码
1 StringBuilder output = new StringBuilder();
2 for (byte i = 0x81; i <= 0xf7; i++)
3 for (byte j = 0x70; j <= 0xfe; j++)
4 output.Append(Encoding.Default.GetString(new byte[] { i, j }));
5 File.WriteAllText("C:\\gbk.txt", output.ToString(), Encoding.UTF8);
2 for (byte i = 0x81; i <= 0xf7; i++)
3 for (byte j = 0x70; j <= 0xfe; j++)
4 output.Append(Encoding.Default.GetString(new byte[] { i, j }));
5 File.WriteAllText("C:\\gbk.txt", output.ToString(), Encoding.UTF8);