vgmrips / vgmtools

A collection of tools for the VGM file format
GNU General Public License v2.0
118 stars 18 forks source link

Inexplicable characters appear in vgm_stat #28

Open denjhang opened 1 year ago

denjhang commented 1 year ago

截图未命名0124234016 tag2.zip All files are in zip

ValleyBell commented 1 year ago

I can't seem to reproduce this with the files you sent, but I know that vgm_stat has trouble with emojis and any other Unicode character that doesn't fit into 16 bits. I'll have a look at this at some point.

ValleyBell commented 1 year ago

I just noticed that you're using an outdated version. Please update to the last release from 2022. The bug you got doesn't happen anymore. (I think it was fixed by d61b4656ee4c9704f84481c470a62b2f45c0ff99.)

denjhang commented 1 year ago

I use vgmtools-2022.12.26 version and compile with vc6. I got this: 截图未命名0127204143

denjhang commented 1 year ago

There is one more question mark here than expected.

ValleyBell commented 1 year ago

vgm_stat reads the Unicode VGM tags, but converts it down to your system's local encoding. That is a lossy process. It then does all the formatting on that converted text.

Fixing this requires a major write, so I'm afraid you will have to just accept that question mark for now and manually fix that line.

At some point I'll get around to rewrite it to apply all formatting to the Unicode text. That should resolve the internal encoding issues and leave only the Windows console itself to cause trouble.

(There is a precompiled version from 2022-12-30 on vgmrips, btw. That one even aligns the 1-hour times properly.)

denjhang commented 1 year ago

vgm_stat reads the Unicode VGM tags, but converts it down to your system's local encoding. That is a lossy process. It then does all the formatting on that converted text.

Fixing this requires a major write, so I'm afraid you will have to just accept that question mark for now and manually fix that line.

At some point I'll get around to rewrite it to apply all formatting to the Unicode text. That should resolve the internal encoding issues and leave only the Windows console itself to cause trouble.

(There is a precompiled version from 2022-12-30 on vgmrips, btw. That one even aligns the 1-hour times properly.)

I tried version 2022.12.30 and there is still a redundant "?".

ValleyBell commented 1 year ago

Yes, that is because this character can not be represented with your system's 8-bit codepage. (That's what I meant with "local encoding".)

You will have to accept that question mark and fix it manually until I do a major rewrite of vgm_stat.