Как мне записать файл в UTF-8 кодировке с BOM
Упорно пишет без BOMа.
Код:
Код: Выделить всё
FileWrite('C:\111.txt', '1111')Код: Выделить всё
FileWrite('C:\111.txt', '1111')Код: Выделить всё
#include
#include
#include
Local $sSourceFile = "Sample.txt"
Local $hSourceFile = FileOpen($sSourceFile, $FO_OVERWRITE + $FO_UTF8)
If $hSourceFile = -1 Then
MsgBox($MB_SYSTEMMODAL, "Error", "Can't open source file [" & $sSourceFile & "].")
Exit(1)
EndIf
FileWrite($hSourceFile, "Мама ")
FileWrite($hSourceFile, "мыла ")
FileWrite($hSourceFile, "раму." & @CRLF)
FileClose($hSourceFile)
Exit(0)