UnicodeDecodeError: 'cp932' codec can't decode byte 0x99
TFWol opened this issue · comments
Hello, just reporting server.py errors out when trying to read scripts.js with error:
python server.py
Traceback (most recent call last):
File "C:\Users\WDAGUtilityAccount\Desktop\_windows sandbox mapped\xVASynth_2\resources\app\server.py", line 16, in <module>
lines = f.read().split("\n")
UnicodeDecodeError: 'cp932' codec can't decode byte 0x99 in position 45308: illegal multibyte sequence
Basically, it won't run with Japanese locale.
I originally tried running the program as normal via xVASynth.exe, but server.exe would just close right away.
- Logs don't show anything obvious dealing with that error, only app.log is written to
app.log
I should mention, running it on an English locale works as expected.
Hey. Yes, other locales have to specifically be added in for it to work (I assume you mean you tried to synth a line using japanese characters?). During the voice training stage. I am currently working on expanding the locale support, so keep an eye out for updates.
Out of curiosity, what line did you try to synth?
Unfortunately, I can't even get the program to run the backend server.py (or .exe).
The xVASynth.exe interface pops up, but the server process that should pop up on port 8008 never starts up.
Here's a video of what I saw as far as the server.exe goes
xVASynth.Error.mp4
Then I tried running it via python which uncovered the real error from my original post
I had to back out of the directory until the relative path could find the script.js file, but it leads to the same encoding error.
From here
Lines 15 to 17 in 5d9ec12
Maybe something along the lines of:
with open(f'{"./resources/app" if PROD else "."}/javascript/script.js',encoding='utf-8') as f:
lines = f.read().split("\n")
APP_VERSION = lines[1].split('"v')[1].split('"')[0]
or have it in a try statement?
It at least was able to get me past the encoding problem for that file.
Oh right, I thought you meant the issue was caused from the text input, not the source files. Ok, I'll definitely add the explicit encoding, if that fixed it for you. I didn't run into this myself. So where are you at now, did you change the python code, and run it from the dev environment?
I don't have anything setup for a full test due to time. I pretty much did a piecemeal approach and stepped through the code while looking up what the errors meant.
I had seen the server could be run directly based on how it was setup so I focused on that with the 5-10 mins I could spare here and there.
After I got past the decode error, using the server.py, it just complained about needed packages that I didn't have since I was using a sandbox (not surprising).
Testing server.exe would require building another one to test what happens after that decode error.
The python code has more files that are read which could spawn the same problem, but I can't test at this time.