- attached enctest.py
National encodings support enhancement
Adds new engine parameter (client_encoding) and makes all strings coming to/from client from/to server to be converted using this encoding.
Also adds automatic convertion to Unicode column types if "client_encoding" is specified
Comments (5)
-
Account Deleted -
Account Deleted It seems to me that there is an error in encodings.diff. Function convert_result_value is receiving strings from database, not from client, so it shouldn't convert values like this:
20 + return unicode(value, engine.client_encoding).encode(engine.encoding)
but like this:
20 + return unicode(value, engine.encoding).encode(engine.client_encoding)
You could also consider avoiding conversion if
engine.encoding == engine.client_encoding
like this:10 + if engine.client_encoding and engine.client_encoding!=engine.encoding and isinstance(value, str): 19 + if engine.client_encoding and engine.client_encoding!=engine.encoding and isinstance(value, str):
-
Account Deleted (original author: redvasily) Thank you, Qvx
You are right. Here's a corrected diff
-
Account Deleted - attached encodings.diff
diff corrected according to notes made by Qvx
-
repo owner - changed status to wontfix
this ones a little over my head, being an american and all, but there was some continued debate over the appropriateness of this one. since i am not thrilled about building extra conditionals into all string types by default, might want to see this implemented as an optional extension. going to mark as 'wontfix' for now.
- Log in to comment
simple test script