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

exception_from_status function gives an UnicodeDecodeError [PYFB72] #88

Closed
firebird-automations opened this issue Nov 19, 2017 · 3 comments

Comments

@firebird-automations
Copy link

Submitted by: Cagatay Tengiz (ctengiz)

This happens only when :

-- database connection set is not utf-8 (ie : win1254)
-- exception is raised with a database exception which includes special charset characters (
ie : CREATE EXCEPTION ACCASH_NOTACTIVE 'Kasa kullanım dışı. Kod:'; --> and when raising this exception we get unicodedecode error)

in http://fbcore.py line 562. there is also a todo remark below this line.

best regards

@firebird-automations
Copy link
Author

Commented by: @pcisar

This is hard one without ideal solution. I changed the code to use locale.getpreferredencoding() instead utf-8. This solution has next characteristics:
- solves problem with national OS versions that return OS-related error messages with national characters
- solves problem with national characters in error messages returned by Firebird if they match the preferred OS encoding. In most cases they match, but in cases they don't developers can go around this issue with proper OS locale settings.

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0 [ 10872 ]

@firebird-automations
Copy link
Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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

No branches or pull requests

2 participants