|
|
bea1a1cd0c
|
Phase 20: UTF-8/multibyte locale support (2026.05.04.4)
Thread CLIENT_LOCALE through to user-data string codecs. Driver previously
hardcoded iso-8859-1 for all string conversions, which broke any locale
outside Western European code points.
* Connection.encoding property derived from client_locale via
_python_encoding_from_locale (en_US.utf8 -> utf-8, en_US.8859-1 ->
iso-8859-1, etc.)
* encode_param / decode / parse_tuple_payload accept an encoding
parameter; cursor and fast-path call sites forward conn.encoding
* Smart-LOB CLOB encode/decode and TEXT decode honor connection encoding
* DataError raised for non-representable chars; cursor releases the
prepared statement before propagating so connection state stays clean
Boundary discipline: protocol-level strings (cursor names, function
signatures, SQ_FILE fnames, error near-tokens, SQL text) stay
iso-8859-1 (always ASCII, never user-controlled).
9 new integration tests in tests/test_unicode.py covering ASCII
round-trip, Latin-1 high-bit, full byte range, locale-mapping,
encoding property, UTF-8 negotiation, multibyte (skipped without
IFX_UTF8_DATABASE), DataError on non-representable, CLOB round-trip.
Total: 69 unit + 212 integration = 281 tests.
|
2026-05-04 17:13:19 -06:00 |
|