CloudBuilder.Topshelf/Task/AI/Character.md
owenchen 597b88d075 ow
2026-05-28 15:49:25 +08:00

25 lines
976 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

static void Main()
{
// 1. 生成 U+4E00 ~ U+9FA5 完整汉字合集
List<char> cjkBasicChars = new List<char>();
for (int code = 0x4E00; code <= 0x9FA5; code++)
{
cjkBasicChars.Add((char)code);
}
// 验证数量(应输出 20976
Console.WriteLine($"基础区汉字总数:{cjkBasicChars.Count}");
// 2. 输出前 10 个汉字(验证生成结果)
Console.WriteLine("前 10 个汉字:");
for (int i = 0; i < 10; i++)
{
Console.Write(cjkBasicChars[i] + " ");
}
// 输出
// 3. 导出为文本文件UTF-8 编码便于查看/使用
string allChars = new string(cjkBasicChars.ToArray());
File.WriteAllText("CJK_Basic_Chars.txt", allChars, System.Text.Encoding.UTF8);
Console.WriteLine("\n已导出完整汉字集到 CJK_Basic_Chars.txt");
}