GrandOrgue / grandorgue

GrandOrgue software
Other
148 stars 40 forks source link

Always save exported combinations with UTF-8-BOM #1821

Closed nanoufo closed 3 months ago

nanoufo commented 4 months ago

Resolves: #1818. The problem occurred due to the utilization of the default system encoding for conversions between wxString and strings in YAML. yaml-cpp treats strings as a sequence of bytes and does not perform encoding conversions.

Now UTF-8 encoding is used for conversions. The exported file now begins with a UTF-8 BOM mark. The UTF-8 BOM mark is used to differentiate documents exported from older GO versions (which use UTF-8 without BOM on Linux/Mac and one of the one-byte encodings on Windows) and to indicate to text editors to use UTF-8 encoding.

While this change has not been tested on Windows yet, it is expected to function properly. Import is broken on Windows, investigating now. Tested on Linux & Windows.