Jump to content

Encoding Detection when reading and writing


Erion
 Share

Recommended Posts

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...