-
Notifications
You must be signed in to change notification settings - Fork 46
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
Document encoding of formatQuery
#80
Comments
It's not that simple, it relies on what ... and also what the I.e. I actually have no idea what the result is when you insert non-ascii text field values. How they are escaped, or whether it indeed depends on |
OK, this is helpful. It does seem to be related to client encoding, which can be specified on the connection string. It might be useful to mention some of this here. As it is, my configuration appears to work OK with UTF-8, but that's a guess and character encoding guesses can go bad. :) |
There is already a paragraph saying
And the resulting type is (EDIT: I often use a |
Yeah, that's what I'm doing. I just want to make sure it's even a sensible first guess as well as what might affect it. This is one of those things that might work well in development but not work at all in production and then wouldn't be noticed until stuff was broken and we needed it. :) |
As I said, I'll avoid giving any general advice here. You should figure out what works in your setup. |
@phadej At this point it might be a sensible option to This causes the Postgres server to convert textual values to UTF-8 even if they are stored as another encoding before sending them to the client, which means that this works even if the server itself uses some different obscure format.
Arguably the codebase assumes that the server sends UTF-8 already, e.g. in the I am happy to provide a PR including tests! Doing this would enable a |
formatQuery
returns aByteString
which is meant to be printed out (debugging, logging, etc...) but the character encoding is not specified. I assume it's UTF-8, but it'd be good to clarify that in the docs. (Or alternatively, returnText
).The text was updated successfully, but these errors were encountered: