Free ANSI to UTF8 Multiple Files converter

1

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.

segfault

Posted 2010-02-25T16:01:14.950

Reputation:

Question was closed 2010-02-25T18:32:10.127

If your outputting to HTML in your app, using the HTML entities will help. – Macha – 2010-02-25T16:24:46.703

1

this question has been asked many times before: http://superuser.com/questions/16672 .. http://superuser.com/questions/27060 .. http://superuser.com/questions/45148 .. http://superuser.com/questions/69091 ..

– quack quixote – 2010-02-25T18:08:46.157

Answers

4

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.

akira

Posted 2010-02-25T16:01:14.950

Reputation: 52 754

this is a good answer (afaik, i'm not a powershell user) and i don't think it's been posted on any of the related/similar questions. if you would, please post it as an answer to the master question: http://superuser.com/questions/27060 ... thanks!

– quack quixote – 2010-02-25T19:18:45.863

consider it done :) – akira – 2010-02-26T06:32:07.897