【发布时间】:2014-01-26 07:38:55
【问题描述】:
我有一个 .smi 文件。 当我用记事本++打开时,我有:
<font color="#FF8040"><I>- °øµ¿¹ø¿ªÀÌ´Ùº¸´Ï Áö¸í°ú À̸§ÀÌ ¾à°£¾¿ Ʋ¸±¼ö ÀÖ½À´Ï´Ù.-</I></font>
然后我设置字符集>韩语> UEC-KR:
<font color="#FF8040"><I>- 공동번역이다보니 지명과 이름이 약간씩 틀릴수 있습니다. -</I></font>
那么,我可以在 C# 中做什么?我希望当我打开文件时,应用程序可以检测字符集并显示在富文本框中。 我用过:
System.IO.StreamReader sr = new System.IO.StreamReader(openFile.FileName);
inputText.Text = sr.ReadToEnd();
inputText.SelectAll();
inputText.SelectionFont = new Font("Arial Unicode MS",9,FontStyle.Regular);
inputText 中的结果:
<font color="#FF8040"><I>- ���������̴ٺ��� ����� �̸��� �ణ�� Ʋ���� �ֽ��ϴ�. -</I></font>
【问题讨论】:
标签: c#