Sign in to follow this  
Followers 0
Erion

Encoding Detection when reading and writing

3 posts in this topic

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

Share this post


Link to post
Share on other sites



See for FileGetEncoding function ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0