Skip to content

Fetch buffered text through UTF-16 - #24

Closed
lovasoa wants to merge 1 commit into
mainfrom
review/buffered-unicode
Closed

lovasoa wants to merge 1 commit into
mainfrom
review/buffered-unicode

Conversation

@lovasoa

@lovasoa lovasoa commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

This PR targets garbled text when buffered fetching is enabled and the ODBC driver returns text in an encoding other than UTF-8. The default unbuffered mode already requests UTF-16 and is unaffected.

The patch requests UTF-16 for buffered text, including decimals represented as text. At the same max_column_size, text payload buffers would use about twice the memory, and the limit would count UTF-16 code units instead of bytes. The binary limit stays in bytes.

Before merging, reproduce the corruption on an affected driver and measure the cost. The PostgreSQL test checks that Unicode and NULL values are still readable on the new path.

Refs #9 and #10.

@lovasoa

lovasoa commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this implementation. I verified that switching to wide buffers makes a working PostgreSQL ANSI buffered read fail with SQLSTATE 07006 in a normal UTF-8 session. It also did not correct the tested LATIN1 case, and it changes buffer sizing for all buffered users. The reproduction and compatibility requirements are recorded in #9.

@lovasoa lovasoa closed this Nov 27, 2026
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

Successfully merging this pull request may close these issues.

1 participant