in-formant / in-formant

software for real-time voice analysis
Apache License 2.0
215 stars 39 forks source link

Cannot start on Windows - possibly due to Unicode usernames? #21

Open sprin-spr opened 3 years ago

sprin-spr commented 3 years ago

Hi Clo, thank you for the wonderful app!

I just learned that you released a new major version of In-Formant. However it seems the app does not start properly -- it terminates right after starting.

I captured its stdout (InFormant-3.0.3.exe > log.txt). It says:

Reading configuration from: "C:\\Users\\°¡³ª´Ù\\AppData\\Roaming\\informant.ini"

My user account on Windows has its name in Korean; so the actual home directory looks like C:\Users\가나다. (Actually it's not 가나다 and the log above not °¡³ª´Ù, but I suppose this is good enough for an example).

The local encoding (like iso-8859-1 or windows-1252 or shift-jis or any other non-UTF-8 encoding schemes) for Korean is cp949, and Windows often defaults to using this encoding for various purposes where Korean characters are expected.

Korean:     가 |    나 |     다
Unicode:  AC00 |  B098 |  B2E4  (U+xxxx codepoints)
CP949:   B0 A1 | B3 AA | B4 D9  (raw bytes when encoded)
latin1:   °  ¡    ³  ª    ´  Ù  (each byte is one char)

The last latin1 result exactly matches what is shown in the captured stdout, so I suppose there has been some encoding issues happening in this exact way that crashed the app right away. Interestingly, the output itself (log.txt file) is properly encoded in UTF-8.

I will also dig into this issue (since I really want to use it!). I think it shouldn't be that hard to fix but I thought I should report this in case anyone else (any non-Latin username users) steps upon the same problem.

Thanks!

sprin-spr commented 3 years ago

This issue stems from cfgpath.h if I am reading it correctly. Here's a relevant link: https://github.com/Malvineous/cfgpath/pull/6

sprin-spr commented 3 years ago

I got this to at least launch properly. What I did was:

At this point, the program would boot only once and never after that. The reason is TOML. So, continued:

Now the program boots OK and does not panic even on acknowledging the previous configuration file, but somehow cannot read from it. (Surprisingly, it can write the config pretty well!)

I don't really have much time to completely fix this, but I hope this helps someone someday.