- Регистрация
- 01.02.2012
- Сообщения
- 4 771
- Благодарностей
- 1 183
- Баллы
- 113
How to reproduce:
Very easy - save file in UTF-8 take all lines from file, when file gets empty encoding changes to ANSI automatically.
WORKAROUND:
Save line in file using c# and line will be saved in UTF-8 without BOM
Cheers
Very easy - save file in UTF-8 take all lines from file, when file gets empty encoding changes to ANSI automatically.
WORKAROUND:
Save line in file using c# and line will be saved in UTF-8 without BOM
JavaScript:
string path = @"C:\MyTest.txt";
// Append text in UTF-8
using (System.IO.StreamWriter sw = System.IO.File.AppendText(path))
sw.WriteLine("Hello World");
Последнее редактирование: