I'm using your kif parser for a personal project, and I saw that you read in different encodings, depending the kifu extension (e.g. if the kifu ends with .kif, it will be read in cp932 and if it ends with .kifu, it will be read in utf-8). Is there a reason to not read every kifu file in utf-8? And why choose cp932 for .kif ? I find it a little bit annoying because 81dojo export kifus in utf-8, with .kif extension, so the parser crash on them. This can be fix just by renaming the file in xxxxx.kifu (and by changing the MOVE_RE regex a little bit, as proposed in a PR).
@sokah2412 Thank you for your comment, and sorry for my late response.
After merging the PR modifying MOVE_RE, I've also added auto encoding detection logic.
It will help us to parse 81Dojo's KIF files.
Hello,
I'm using your kif parser for a personal project, and I saw that you read in different encodings, depending the kifu extension (e.g. if the kifu ends with .kif, it will be read in cp932 and if it ends with .kifu, it will be read in utf-8). Is there a reason to not read every kifu file in utf-8? And why choose cp932 for .kif ? I find it a little bit annoying because 81dojo export kifus in utf-8, with .kif extension, so the parser crash on them. This can be fix just by renaming the file in xxxxx.kifu (and by changing the MOVE_RE regex a little bit, as proposed in a PR).
Thank you very much :)