fork download
  1. using System;
  2. using System.Globalization;
  3. using System.Windows.Forms;
  4.  
  5. namespace WindowsFormsApplication1
  6. {
  7. public partial class Form1 : Form
  8. {
  9. public Form1()
  10. {
  11. InitializeComponent();
  12.  
  13. var culture = CultureInfo.GetCultureInfo("ja-JP");
  14.  
  15. this.textBox1.AppendText("小文字->大文字の順に変換したら違う文字になったもの\r\n");
  16. hoge(0x0000, 0xD7FF, (s) => s.ToLower(culture), (s) => s.ToUpper(culture));
  17. hoge(0xE000, 0xFFFF, (s) => s.ToLower(culture), (s) => s.ToUpper(culture));
  18.  
  19. this.textBox1.AppendText("大文字->小文字の順に変換したら違う文字になったもの\r\n");
  20. hoge(0x0000, 0xD7FF, (s) => s.ToUpper(culture), (s) => s.ToLower(culture));
  21. hoge(0xE000, 0xFFFF, (s) => s.ToUpper(culture), (s) => s.ToLower(culture));
  22. }
  23.  
  24. void hoge(int start, int end, Func<string, string> conv1, Func<string, string> conv2)
  25. {
  26. for (int code = start; code <= end; code++)
  27. {
  28. var s = new string((char)code, 1);
  29. var c1 = conv1(s);
  30. var c2 = conv2(c1);
  31.  
  32. if (s != c2 && s != c1)
  33. {
  34. textBox1.AppendText(string.Format("元の文字:{0}(U+{1:X4})->{2}(U+{3:X4})->{4}(U+{5:X4})\r\n", s, (int)s[0], c1, (int)c1[0], c2, (int)c2[0]));
  35. }
  36. }
  37. }
  38. }
  39. }
  40.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty