Free ANSI to UTF8 Multiple Files converter [duplicate]

Posted on

QUESTION :

Possible Duplicates:
Batch-convert files for encoding or line ending under Windows
App to convert from ANSI to UTF8 on windows

Hi,

currently i’m in need of a way to convert loads of .txt files in ANSI to UTF8, since i just found out that a app i’m making doesnt recognize accents when they are in ANSI.

I’ve tried cp converter, but it doesnt work… not only the files after converting still appear as ANSI, but it also doesnt recognize the accents, replacing them with a ?, which is basically the problem i have in my app.

ANSWER :

with powershell you can do something like this:

%  get-content IN.txt | out-file -encoding ENC -filepath OUT.txt

while ENC is something like unicode, ascii, utf8, utf32. checkout ‘help out-file’.

to convert all the *.txt files in a directory to utf8 do something like this:

% foreach($i in ls -name DIR/*.txt) { get-content DIR/$i | out-file -encoding utf8 -filepath DIR2/$i }

which creates a converted version of each .txt file in DIR2.

Leave a Reply

Your email address will not be published.