Jump to content
Roger Cigol

Saving files as UTF-8 with BOM

Recommended Posts

It seems that Embarcadero are encouraging C++ (new tool chain) users to save source code as UTF-8 with BOM. Can anyone find an option in the IDE set up to force files to be saved in this format ?

  • Like 1

Share this post


Link to post

A file is stored in the format it has been loaded, unless you change the format via the File Encoding selector at the bottom of the editor.

image.thumb.png.6fb7a62ce1b27cd9a5c86a4afd2462c1.png

 

You can change the default encoding for new files in the Editor options.

  • Like 1
  • Thanks 1

Share this post


Link to post

I can confirm that UTF8 will be saved with BOM, certainly in the 12.3 editor.

Share this post


Link to post

It is with BOM since the IDE introduced the file format. I believe I am using since XE5(?).

 

Edit. I was wrong since D2007.

Edited by Lajos Juhász

Share this post


Link to post
2 hours ago, Uwe Raabe said:

You can change the default encoding for new files in the Editor options.

Thanks @Uwe Raabe I knew it had to be somewhere - and I have now found both with the help of your hints!

Share this post


Link to post

...and AFAIR there's a registry option to use UTF-8 without BOM if one wants to make life "more interesting".

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

×