Erion Posted January 29, 2011 Share Posted January 29, 2011 Hello, I'm trying to make a universal text replacer utility which works accross multiple files, inside compressed files, etc. (Not sure about binary mode, yet.) Is there a reliable way to detect character encoding in a file? I know that the built in reading functions can automagically do it, though I will most probably have trouble writing the result back, as I am not sure whether the write functions are unicode aware too. Also, AutoIt has certain limits, but I'd like to optimise code as much as possible. Any advice regarding this would be great. Erion Link to comment Share on other sites More sharing options...
wakillon Posted January 29, 2011 Share Posted January 29, 2011 See for FileGetEncoding function ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Erion Posted January 29, 2011 Author Share Posted January 29, 2011 Hello, Yes. The problem with that is I would have to open the file in reading mode, get the encoding, close the file, open it again in the mode the function returns, read it in, close, open for writing (if its ansi), write... When doing many operations on thousands of files it seems a bit slow, especially if I am doing regexp replacing too. Erion 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