Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change saved song file encoding to UTF-8 without BOM #428

Merged
merged 1 commit into from
Dec 28, 2023

Conversation

Tuupertunut
Copy link
Contributor

What does this PR do?

Currently Ultrastar Play song editor saves all song files as UTF-8 with BOM. This happens because in code the encoding is System.Text.Encoding.UTF8, which produces a BOM according to documentation.

This PR changes the encoding for saved song files to UTF-8 without BOM.

Closes Issue(s)

Motivation

The Ultrastar format specification was recently updated. It now specifies that all song files should use UTF-8 without BOM as their encoding. There are also tools in the Ultrastar ecosystem, such as Performous Composer, that fail to open song files with BOM.

There is some discussion about UTF-8 BOMs in this Ultrastar format issue UltraStar-Deluxe/format#42

More

Additional Notes

I have not tested this code. The change seems trivial enough that I'm confident it would work.

Previously the encoding was System.Text.Encoding.UTF8, which produces a BOM at the beginning of the saved file. Now it is a new System.Text.UTF8Encoding, which does not produce a BOM.
Copy link
Member

@basisbit basisbit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the improvement!

@basisbit basisbit merged commit 18869a3 into UltraStar-Deluxe:master Dec 28, 2023
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants