#include #include _Test() Func _Test() Local $sFileFullPath = @ScriptDir & '\test_file_encoding.txt' ; FileWrite with $FO_UTF8_NOBOM _FileWrite_StringContent($sFileFullPath, 'poniedziałek, wtorek, środa, czwartek, piątek, sobota, niedziela') ; FileRead with FileGetEncoding() Local $sResult = _FileRead_StringContent($sFileFullPath) MsgBox(0, '$sResult', $sResult) ; FileRead - simply with out : FileOpen + FileClose Local $sResult2 = FileRead($sFileFullPath) MsgBox(0, '$sResult2', $sResult2) EndFunc ;==>_Test Func _FileWrite_StringContent($sFileFullPath, $sContent) Local $hFile = FileOpen($sFileFullPath, $FO_OVERWRITE + $FO_CREATEPATH + $FO_UTF8_NOBOM) FileWrite($hFile, $sContent) FileClose($hFile) EndFunc ;==>_FileWrite_StringContent Func _FileRead_StringContent($sFileFullPath) ConsoleWrite(FileGetEncoding($sFileFullPath) & @CRLF) Local $hFile = FileOpen($sFileFullPath, $FO_READ + FileGetEncoding($sFileFullPath)) Local $sContent = FileRead($hFile) FileClose($hFile) if IsBinary($sContent) then ConsoleWrite('IsBinary -- converting to string') $sContent = BinaryToString($sContent,1 ) EndIf Return $sContent EndFunc ;==>_FileRead_StringContent