将俄语符号转换为字符串

将俄语符号转换为字符串

问题描述:

我想要这个:[ñâûøå]转换成这个:[свыше].
.
我想翻译ru-en/en-ru.
我的纯文本中包含一些俄语单词:
此文本具有html标记. (我想保留它们).
我想这些符号是UTF-8编码(不确定).
我想将这些符号转换为字符串.
怎么做?
.
.
.
.
.
[重新编辑]
我发现纯文本正在使用[Windows 1252:西欧]编码器!
我使用了这段代码,变量"text"包含西欧编码.

I want this : [ñâûøå] to convert it into this: [свыше].
.
I want to make a translator ru-en/en-ru.
And I have this plain text who contain some Russian words:
This text have html tags. (I want to keep them).
I suppose those symbols are encodings in UTF-8(not sure).
I want to convert those symbols in string.
How to do that?
.
.
.
.
.
[RE-EDITED]
I discovered that the plain text is using the [Windows 1252: Western European] encoder!
I used this code and the variable "text" contains the Western European encoding.

StreamReader sr = new StreamReader(file, System.Text.Encoding.Default); 
string text = sr.ReadToEnd();


我需要将1252转换为[Windows 1251:西里尔文].
该怎么做?
.
.
.
.
.
这是纯文本视图:


I need to convert the 1252 into [Windows 1251: Cyrillic].
How to do that?
.
.
.
.
.
This is the plain text view:

<tr><td class=t>
<B>above</B>  <B><br>&nbsp;&nbsp;1.</B> <I>adv</I> <br>&nbsp;&nbsp;&nbsp;&nbsp;1) íàâåðõó, íàâåðõ; <br>&nbsp;&nbsp;&nbsp;&nbsp;2) âûøå; <B><br>&nbsp;&nbsp;2.</B> <I>prep</I> <br>&nbsp;&nbsp;&nbsp;&nbsp;1) <I>â ïðîñòðàíñòâåííîì çíà÷åíèè óêàçûâàåò íà ìåñòîíàõîæäåíèå íàä ÷åì-ë.</I>; <br>&nbsp;&nbsp;&nbsp;&nbsp;2) <I>âî âðåìåííîì çíà÷åíèè óêàçûâàåò íà ÷òî-ë., ïðîèñøåäøåå äî îïðåäåë¸ííîãî âðåìåíè, ïåðèîäà è ò. ï.</I> íå äàëåå ÷åì, äî; <br>&nbsp;&nbsp;&nbsp;&nbsp;3) <I>óêàçûâàåò íà ÷èñëåííîå ïðåâûøåíèå</I> áîëåå, ñâûøå; <br>&nbsp;&nbsp;&nbsp;&nbsp;4) <I>óêàçûâàåò íà ïðåâîñõîäñòâî íàä ÷åì-ë.</I> âûøå, ñâûøå 
</td></tr>



使用StreamReader时,出现以下符号:



When I use StreamReader I get these symbols:

<tr><td class=t>
<B>above</B>  <B><br>&nbsp;&nbsp;1.</B> <I>adv</I> <br>&nbsp;&nbsp;&nbsp;&nbsp;1) �������, ������; <br>&nbsp;&nbsp;&nbsp;&nbsp;2) ����; <B><br>&nbsp;&nbsp;2.</B> <I>prep</I> <br>&nbsp;&nbsp;&nbsp;&nbsp;1) <I>� ���������������� �������� ��������� �� ��������������� ��� ���-�.</I>; <br>&nbsp;&nbsp;&nbsp;&nbsp;2) <I>�� ��������� �������� ��������� �� ���-�., ����������� �� ������������ �������, ������� � �. �.</I> �� ����� ���, ��; <br>&nbsp;&nbsp;&nbsp;&nbsp;3) <I>��������� �� ��������� ����������</I> �����, �����; <br>&nbsp;&nbsp;&nbsp;&nbsp;4) <I>��������� �� ������������� ��� ���-�.</I> ����, �����
</td></tr>



这就是它在浏览器中的呈现方式:



and this is how it render inside a browser:

above  
  1. adv 
    1) наверху, наверх;
    2) выше; 
  2. prep 
    1) в пространственном значении указывает на местонахождение над чем-л.; 
    2) во временном значении указывает на что-л., происшедшее до определённого времени, периода и т. п. не далее чем, до;  
    3) указывает на численное превышение более, свыше; 
    4) указывает на превосходство над чем-л. выше, свыше 


-感谢-


-Thanks-

仅使用Unicode,而忽略了Windows-1252,Windows-1251…

这根本没有任何意义:我需要将1252转换为[Windows 1251:西里尔文]".

从此处了解Unicode的工作原理:
http://en.wikipedia.org/wiki/Unicode [ http://unicode.org/ [ ^ ],
http://unicode.org/faq/utf_bom.html [如何在C#中将ascii转换为unicode [
Use only Unicode and forget about all that Windows-1252, Windows-1251…

This makes no sense at all: "I need to convert the 1252 into [Windows 1251: Cyrillic]".

Learn about how Unicode works from here:
http://en.wikipedia.org/wiki/Unicode[^],
http://unicode.org/[^],
http://unicode.org/faq/utf_bom.html[^].

Please understand what Unicode is not: it is not encoding, it is not UTF, it is not 16-bit code.

Maybe my basic explanations in my recent solution can help you: How do i convert from ascii to unicode in C#[^].

—SA