You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JsonIO.readFromFile and .writeToFile create FileReader and FileWriter objects to handle file I/O. These classes always use the default character encoding, which can vary based on the operating system or the user's general system settings.
This is mostly going to go unnoticed, as the most common encodings are compatible for common (basic ASCII) characters. One major exception is color formatting, which uses the "section sign" as an marker. This character may be encoded as A7 in "extended ASCII" encodings such as ISO8859-1, but is encoded as C2 A7 in UTF-8.
JsonIO.readFromFile
and.writeToFile
createFileReader
andFileWriter
objects to handle file I/O. These classes always use the default character encoding, which can vary based on the operating system or the user's general system settings.This is mostly going to go unnoticed, as the most common encodings are compatible for common (basic ASCII) characters. One major exception is color formatting, which uses the "section sign" as an marker. This character may be encoded as
A7
in "extended ASCII" encodings such as ISO8859-1, but is encoded asC2 A7
in UTF-8.Here is one instance of this issue in the wild. I've also been able to reproduce it with the following steps:
-Dfile.encoding=iso8859-1
.QuestDatabase.json
with a hex editor. Note theA2
bytes.-Dfile.encoding=utf-8
.QuestDatabase.json
with a hex editor again. Note theA2
bytes have been replaced byEF BF BD
(the "replacement character" sequence).I'd suggest explicitly specifying UTF-8 for both input and output. Something like:
...and similar for writing.
The text was updated successfully, but these errors were encountered: