MattHiggs Posted September 11, 2017 Share Posted September 11, 2017 (edited) Hello autoit community. So this is an issue that I have run into before and never really cared enough until now to figure out what is going on. I wrote an autoit script which would create a txt file and write 253 lines in the txt file and then close it (I have attached the txt file). The only flag I used when calling "Fileopen" was 2 (overwrite flag). I then went and wrote a powershell script which would create files in a particular directory and use the content imported from the txt file created by the Autoit script when naming these files. However, in doing this, there are many files which has very strange characters that obviously should not be there: I believe that this is a file encoding issue, so my question is as follows: If I want powershell, vbscript engine, etc. to correctly read the characters contained within an autoit generated text file, what flag(s) should I call "Fileopen" with in order ensure that the created file has the right encoding? newbooks.txt Edited September 11, 2017 by MattHiggs Link to comment Share on other sites More sharing options...
Danyfirex Posted September 11, 2017 Share Posted September 11, 2017 Hello. By default AutoIt write using UTF-8 if you want that AutoIt write in the textfile the characters exactly as you show in the picture use the $FO_ANSI+$FO_OVERWRITE in the flag of FileOpen. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
MattHiggs Posted September 11, 2017 Author Share Posted September 11, 2017 15 minutes ago, Danyfirex said: Hello. By default AutoIt write using UTF-8 if you want that AutoIt write in the textfile the characters exactly as you show in the picture use the $FO_ANSI+$FO_OVERWRITE in the flag of FileOpen. Saludos Ok. So, I would like to clarify something on that note.... Does the "$FO_ANSI" flag set the file encoding to ASCII? I was under the impression ASCII was the encoding the file needed to be in, and initial research seemed to suggest the ANSI and ASCII were different things. Am I wrong? Link to comment Share on other sites More sharing options...
Danyfirex Posted September 11, 2017 Share Posted September 11, 2017 to ANSI I think https://stackoverflow.com/questions/700187/unicode-utf-ascii-ansi-format-differences Saludos MattHiggs 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
MattHiggs Posted September 11, 2017 Author Share Posted September 11, 2017 2 minutes ago, Danyfirex said: to ANSI I think https://stackoverflow.com/questions/700187/unicode-utf-ascii-ansi-format-differences Saludos Ahh. Very interesting. Easy to understand and answers my question. I wish that documentation [that I initially read] would just state it simply like that post did, rather than confuse the hell out of people by over complicating the subject. Link to comment Share on other sites More sharing options...
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