orbs Posted August 16, 2014 Posted August 16, 2014 (edited) the help file states: "... functions such as FileReadLine..." regarding functions that automatically detect the file encoding. which are the other "such" functions? is FileReadToArray() one of them? i'm also unsure on how to test this. i used a simple script to FileOpen() a new text file with all encoding formats mentioned in the FileOpen() help. then i used FileReadToArray() to read it - i get back a good result for all encoding formats. so either FileReadToArray() is detecting the encoding properly, or i'm testing it wrong. how can i be sure? EDIT: that's my test script. using 128,64,32,16 instead of 256 for encoding formats. #include <Array.au3> $sFile=@ScriptDir&'\FileReadToArray-test.txt' $hFile=FileOpen($sFile,2+256) FileWriteLine($hfile,'Line1') FileWriteLine($hfile,'Line2') FileClose($hFile) $a=FileReadToArray($sFile) _ArrayDisplay($a) Edited August 16, 2014 by orbs Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff
czardas Posted August 16, 2014 Posted August 16, 2014 I would say your testing method is sound. Rather than just opening the files, I assume you also wrote to each file with different encoding options. I can't imagine how FileReadToArray could work at all if it didn't automatically detect the encoding. operator64 ArrayWorkshop
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now