I doubt it, too... but I did try and it didn't work... in the last post
I forgot to attach the result with sample string, my fault...
In this post I attached the result file of the test, and I tried to
System.Console.WriteLine(Data == BackConvert) before, it give me a False.
You can try it yourself... use the first line in the attached file as
the sample string...
Jon Skeet [C# MVP] wrote:
FrzzMan <Fr***************@vnOCzone.com> wrote:
.NET GetBytes() and GetString() didn't work right with UTF-8 charset.
My following code prove that...
string Data = "UTF-8 string"; // <-- Insert some *long* UTF-8 string
byte[] DataBytes = System.Text.Encoding.UTF8.GetBytes(Data);
string BackConvert = System.Text.Encoding.UTF8.GetString(DataBytes);
System.IO.StreamWriter File = System.IO.File.CreateText("test.txt");
File.Write(Data + "\n" + BackConvert);
File.Close();
Wait a lil, see the attached text file, open it with your browser and
set browser text encoder to UTF-8, you'll see the different...
Um, I doubt it, to be honest. You'll need to give us a sample string to
show us what you mean.
To check that the strings are the same, you could just use
Console.WriteLine (Data==BackConvert);
miniLZO -- mini subset of the LZO real-time data compression library Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o...
miniLZO -- mini subset of the LZO real-time data compression library Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không n*o... Đây l* tiếng Việtꀜҥnén th* coi cóꁦҥược không n*o... Đây l* tiếng Việt, nén ꀰҥ* coi có được không n*o... Đây l* tiếng ꁶҥệt, nén th* coi có được không n*o... Đây l* tiếng Việt, nén th* coi có được không ꂍҥo...