Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'cp932' codec can't decode byte 0x99 #28

Open
TFWol opened this issue Dec 10, 2021 · 7 comments
Open

UnicodeDecodeError: 'cp932' codec can't decode byte 0x99 #28

TFWol opened this issue Dec 10, 2021 · 7 comments

Comments

@TFWol
Copy link

TFWol commented Dec 10, 2021

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
@TFWol
Copy link
Author

TFWol commented Dec 10, 2021

I should mention, running it on an English locale works as expected.

@DanRuta
Copy link
Owner

DanRuta commented Dec 10, 2021

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?

@TFWol
Copy link
Author

TFWol commented Dec 10, 2021

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

@TFWol
Copy link
Author

TFWol commented Dec 10, 2021

Then I tried running it via python which uncovered the real error from my original post

@TFWol
Copy link
Author

TFWol commented Dec 10, 2021

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.
server exe codec error

From here

xVA-Synth/server.py

Lines 15 to 17 in 5d9ec12

with open(f'{"./resources/app" if PROD else "."}/javascript/script.js') as f:
lines = f.read().split("\n")
APP_VERSION = lines[1].split('"v')[1].split('"')[0]

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.

@DanRuta
Copy link
Owner

DanRuta commented Dec 10, 2021

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?

@TFWol
Copy link
Author

TFWol commented Dec 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants