Ejoc Posted February 27, 2008 Share Posted February 27, 2008 So I've been searching and searching, but haven't found any examples that cover what I'm trying to do, which as far as I can tell should be simple. How do I read a UTF-8 encoded text file and have the unicode characters preserved in the script? As it is now, the unicode characters are "mangled" and the 3 character header at the beginning of the file is being read in as ascii. Ideally I would be able to use FileOpen() and FileReadLine() I just need it displayed correctly in the GUI Thanks Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
The Kandie Man Posted February 27, 2008 Share Posted February 27, 2008 Try using FileOpen with UTF-8 mode. - The Kandie Man ;-) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Ejoc Posted February 27, 2008 Author Share Posted February 27, 2008 Try using FileOpen with UTF-8 mode.- The Kandie Man ;-)The help file for Filopen makes no mention of this Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
The Kandie Man Posted February 27, 2008 Share Posted February 27, 2008 The help file for Filopen makes no mention of thisWhat version of AutoIt are you using? Older versions of AutoIt didn't have this option. This option has been around for probably about a year though now.http://www.autoitscript.com/autoit3/docs/f...ns/FileOpen.htm- The Kandie Man ;-) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 27, 2008 Moderators Share Posted February 27, 2008 The help file for Filopen makes no mention of thisYou must have an old version of AutoIt FileOpen --------------------------------------------------------------------------------Opens a text file for reading or writing.FileOpen ( "filename", mode ) Parametersfilename Filename of the text file to open. mode Mode (read or write) to open the file in.Can be a combination of the following: 0 = Read mode 1 = Write mode (append to end of file) 2 = Write mode (erase previous contents) 4 = Read raw mode 8 = Create directory structure if it doesn't exist (See Remarks). 16 = Force binary(byte) reading and writing mode with FileRead and FileWrite 32 = Use Unicode UTF16 Little Endian mode when writing text with FileWrite and FileWriteLine (default is ANSI) 64 = Use Unicode UTF16 Big Endian mode when writing text with FileWrite and FileWriteLine (default is ANSI) 128 = Use Unicode UTF8 when writing text with FileWrite and FileWriteLine (default is ANSI)Both write modes will create the file if it does not already exist. The folder path must already exist (except using mode '8' - See Remarks). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
GaryFrost Posted February 27, 2008 Share Posted February 27, 2008 He's been away a while SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Ejoc Posted February 27, 2008 Author Share Posted February 27, 2008 3.2.0.1 Updating did it, sigh that was lame Thanks Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs 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