Jump to content
Tommi Prami

have anyone made tool to convert Delphi files from Ansi to UTF-8

Recommended Posts

Not super complicated app, but if someone has that ready would help.

I think someone talked about it, but have no clue on which thread.



Share this post

Link to post

I wrote a small script ConvertToUTF8.sh to convert all * .pas and * .dpr files from ANSI to UTF-8, which writes the results of its work to a file (conversion is performed for all files inside the current folder and its subdirectories). You can first run FindNotUTF8.sh to find all files in a non-UTF-8 encoding (the results of the script are also output to a file).

Share this post

Link to post



Using the ZIP2 component (but unit can be renamed to Zip to use the Delphi default) for creating backup copies. Finished 3000+ files in 90 seconds in our project at work.

It checks for BOM existence; so if you have actual UTF8 files without BOM it can cause issues.

  • Thanks 1

Share this post

Link to post

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