Additional Information: It is not possible to translate the Unicode character \ uDFFF to index 195 on the specified code page.
I created an algorithm that results in binary values โโ(different lengths). I converted it to uintand then to characters and saved in stringbuilder, as you can see below:
uint
uint n = Convert.ToUInt16(tmp_chars, 2); _koded_text.Append(Convert.ToChar(n));
My problem is that when I try to save these values โโin .txt, I get the previously mentioned error.
StreamWriter file = new StreamWriter(filename); file.WriteLine(_koded_text); file.Close();
What I am saving is: "ๅฟฟ ์ทพ แทฟ] ๋ณฏ ่ค ุจุฎู ็ข ุณู ไผ ูู๏ ใฟฏ ู ็ฟผ ใป ู ู ู ็ญน ๏ทฟ ํฟ ๎ ๎ ๎ ๎ ๎ ๎ which are some strange signs.
- txt. - , UTF8 , , . ?
. Unicode utf16 .NET. , 65536 . Unicode . , Unicode \uffff ( BMP, Basic Multilingual Plane) . 0xd800 0xdbff, - 0xdc00 0xdfff. 2 ^ (10 + 10) = 1 .
, , (0xdfff), . . , , - , , .
. Base64 - . 6 , 3 - 4 . - ASCII, , , . IBM, EBCDIC, . .
SO : " - base64?" ASCII/ANSI .