[JDBC] jdbc-4.1 v42.0.0 - set client_encoding
От | Rob Resendez |
---|---|
Тема | [JDBC] jdbc-4.1 v42.0.0 - set client_encoding |
Дата | |
Msg-id | CAOfv7YcgExpLi3MrUi54=_aA3k1=0wobXDoYMjq_D7=G1WdxVA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: [JDBC] jdbc-4.1 v42.0.0 - set client_encoding
Re: jdbc-4.1 v42.0.0 - set client_encoding |
Список | pgsql-jdbc |
jdbc-4.1 v42.0.0
Our database enoding is "SQL_ASCII". JDBC's client_encoding is "UTF-8" We're making the leap from pg9.2 to 9.6... and existing code has started throwing exceptions:
"invalid byte sequence for encoding "UTF8"..."
Per this thread:
https://www.postgresql.org/message-id/55CA237A.4080300@nqadmin.com
"9.4 is intentionally less lax about that than prior versions" (regarding character data not supported by the client encoding)
We've decided to force the JDBC client_encoding to "SQL_ASCII". Per the docs, "allowEncodingChanges" will allow "SET client_encoding..." execution; However, I'm wondering if there is a way to force the connection to use a particular encoding to begin with?
I've tried "props.setProperty('client_encoding', ...)" without success.
Thanks
Our database enoding is "SQL_ASCII". JDBC's client_encoding is "UTF-8" We're making the leap from pg9.2 to 9.6... and existing code has started throwing exceptions:
"invalid byte sequence for encoding "UTF8"..."
Per this thread:
https://www.postgresql.org/message-id/55CA237A.4080300@nqadmin.com
"9.4 is intentionally less lax about that than prior versions" (regarding character data not supported by the client encoding)
We've decided to force the JDBC client_encoding to "SQL_ASCII". Per the docs, "allowEncodingChanges" will allow "SET client_encoding..." execution; However, I'm wondering if there is a way to force the connection to use a particular encoding to begin with?
I've tried "props.setProperty('client_encoding', ...)" without success.
Thanks
В списке pgsql-jdbc по дате отправления: