Vocaluxe / Vocaluxe

Vocaluxe is an open source singing game inspired by SingStar™ and Ultrastar Deluxe.
https://vocaluxe.org
GNU General Public License v3.0
284 stars 80 forks source link

Implement UTF-8 (without BOM) encoding support #633

Closed marwin89 closed 8 months ago

marwin89 commented 9 months ago

Suggestion

Introduce UTF-8 (Without BOM) Encoding for song textfiles as standard/default. Right now Vocaluxe only support UTF-8 (with BOM).

Why?

Additional Info: vocaluxe is the only game that doesn't handle UTF-8 (Without BOM) at the moment encoding-confusion

marwin89 commented 9 months ago

@flokuep : could you estimate the effort of this issue on occassion maybe? (This confusion about encoding comes always up in help desk) 👋 😃

flokuep commented 9 months ago

Quick win: Move the prefered encoding for file loading into a configuration (and set UTF-8 as default if that's the USDB default) - Size: S

Alternative: Include a library that identify the file encoding so that all files could be loaded in the correct way. Check https://stackoverflow.com/questions/3825390/effective-way-to-find-any-files-encoding for some ideas. Size: M to L.

Stefan1200-de commented 9 months ago

Well, in fact Vocaluxe supports UTF-8 without BOM, but only if you add the following line to the txt file header:

ENCODING:UTF8

But of course, it would be better to switch to UTF8 as the default encoding. But this may break everything for current Vocaluxe users. So the best way would be to add a good working auto detection to Vocaluxe with UTF8 as default and fallback value.

Maybe I play around with that in the next week, but if someone already has a good idea, I would be open for a pull request too.