Allow .LST and .LBL files to be saved and opened in UTF-8 even without BOM

I suggest to implement the following feature:

Allow .LST and .LBL files to be saved and opened in UTF-8 encoding.

A typical use case might be:

I know this is a tough one. Currently .LST files are UTF16 encoded. This makes perfect sense to support chinese, japanese and other language projects.

But in the year 2020 everyone uses UTF-8. With UTF-8 there is no endianess problem. The endian is always right. As a downside chinese and japanese language project files could get bigger, but it depends.

Direct manipulation of .LST and .LBL files will be easier because UTF-8 has the widest support nowadays.

It will also be the better encoding if combit, someday, will deliver LL for other platforms like Mac and Linux :slight_smile:

The main benefit will be: I could save my layouts without problems in Git to get version management. I then could diff them to get a feeling what has changed to prior versions. This is not perfect but sometimes really helpful to get a clue what’s different.
Just for reference which problems could evolve by using git with UTF-16 encoding: utf 16 - Why doesn't Git natively support UTF-16? - Stack Overflow

If you implement this feature, please be aware of BOM and BOMless UTF-8 files. Other platforms prefer BOMless UTF8-files.

Actually, there’s already an option for this:

#define LL_OPTION_SAVE_PROJECT_IN_UTF8 (178) /* BOOL, default 0 (meaning: project is saved as UNICODE if A API is not used) */

Would that help :slight_smile:?

It helps a lot! Finally I can use git diff with default settings without tweaking git!

One thing I noticed:
SAVE_PROJECT_IN_UTF8 is missing in the .Net LlOption enumeration!
I got it working by using: ll.Core.LlSetOption(178, 1);

As BOMless UTF-8 files are prefered if using multiple platforms, please implement

#define LL_OPTION_SAVE_PROJECT_IN_UTF8BOMLESS (179)

Thanks!

We will add this to the enumeration with the next service pack for LL26. If we tackle the BOM less setting, it would probably be a value of “2” for the option. I’ll keep this thread updated.

A value of “2” will do the trick in LL27 then.