Determines the text encoding used in a file.
FileGetEncoding ( "filehandle/filename" [, mode = 1] )
If a filename is given rather than a file handle - the file will be opened and closed during the function call.
Note: Do not mix filehandles and filenames, i.e., don't FileOpen() a file and then use a filename in this function. Use either filehandles or filenames in your routines, not both!
If a file handle is used then the "mode" parameter has no effect - the mode used for FileOpen() takes precedence.
FileOpen, FileRead, FileReadLine, FileWrite, FileWriteLine
#include <MsgBoxConstants.au3>
Example()
Func Example()
Local $iEncoding= FileGetEncoding (@ScriptFullPath ); Retrieve the file encoding of the current script.
If @error Then
MsgBox ($MB_SYSTEMMODAL,"","Error: Could not obtain the file encoding.")
Else
MsgBox ($MB_SYSTEMMODAL,"","FileGetEncoding: The value returned was: "&$iEncoding); The value returned for this example should be 0 or $FO_ANSI.
EndIf
EndFunc ;==>Example