-
Notifications
You must be signed in to change notification settings - Fork 508
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
unicode error when view source file which is not utf-8 encoded #292
Comments
Hi kuna, I'm facing the same problem now. I tried to follow your solution but I couldn't find the backend.py. At your convenience, could you give me some advice? Thanks! |
Looks like you search for gdbgui/gdbgui/server/http_routes.py Line 55 in 531d898
Just out of interest: what is the output of Looks like #347 is related to this. |
Hi @GitMensch,
|
I encountered this issue when I attempt to open cp949 encoded file. I think same issue would occur with shift-jis encoded file and these can be easily reproduced.
'utf-8' codec can't decode byte 0xc0 in position ~
The problem is in
backend.py:read_file
method. In here, it attempts to read source file with defaultopen()
method, which reads file as unicode by default. Exception occurs when file is not in unicode. I thinkcodecs.open
with correct encoding option is necessary. correct encoding shall be passed with gdbgui parameter or use session environment variable.Currently I modified
backend.py:689
line to set encoding from my environment variable and no problem.Environments are,
Ubuntu 14.04
gdbgui 0.13.2.0 (downloaded from pip)
gdb 8.2
firefox 66.0.3
Thanks.
ps. Fixed error message as previous one was incorrect.
The text was updated successfully, but these errors were encountered: