scripts icon indicating copy to clipboard operation
scripts copied to clipboard

fix encoding issue

Open dtlnor opened this issue 2 years ago • 2 comments

  • windows can't read utf-8 json properly without explicit define the encoding format

dtlnor avatar Sep 25 '22 17:09 dtlnor

Thank you for the contribution! I don't have a Windows machine to test right now, but you might also be able to fix this by setting the code page to 65001 (utf-8) before running the tool. I'm just lazy to set it explicitly because usually my systems are UTF-8 by default. Anyway, explicit encoding is the correct way to do it.

There are also some other uses of open in the code that are not in binary mode (wb/rb) and lack an explicit encoding. Maybe it's good to change those as well while at it.

By the way, I haven't used this for some time, so you can feel free to start maintaining your own fork of the contents of the ./danmaku/ directory and I'll link to it in this repo. I release it to the public domain but you can mention the origin if you want to.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chcp https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers

siikamiika avatar Sep 29 '22 17:09 siikamiika

Sorry for the late reply, I have added explicit encoding for those not in binary mode. Glad to know you are welcome to link my clone, but since I am not going to maintain this actively ~~(like I forgot to check the update of this pr about a month)~~, I think I will just keep focusing on your repo.

dtlnor avatar Nov 04 '22 03:11 dtlnor