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
When I try to read this nbs file: Can't read this.zip (which has been zipped because I can't drag the file onto here directly) it says: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 13: invalid continuation byte
The text was updated successfully, but these errors were encountered:
Hi! There's currently an issue with the way Note Block Studio encodes strings. Although characters to be written are encoded as UTF-16, NBS only writes the rightmost byte to the file. However, when reading it back into a character, it uses the system's encoding - ANSI, since it runs on Windows -, which, in spite of producing an incorrect character, doesn't result in an error when opening the song, since ANSI has a codepoint for every possible byte.
In this particular case, the MIDI you created the song from seems to contain Japanese characters. Since an encoding is not being specified in pynbs, it's being assumed as UTF-8. Due to the buggy value written to the file, some bytes may actually turn out to be invalid UTF-8, resulting in the error. The best we can do here is to read the string using the ANSI codec to mimic the behavior of NBS, which will still result in incorrect characters, but at least won't cause an error. Eventually, NBS must be patched to handle special characters a bit better than simply truncating the bytes.
When I try to read this nbs file: Can't read this.zip (which has been zipped because I can't drag the file onto here directly) it says:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd2 in position 13: invalid continuation byte
The text was updated successfully, but these errors were encountered: