fix: use UTF-8 instead of US-ASCII for initial encoding #398
Conversation
@@ -99,7 +99,7 @@ public Struct createStruct(String typeName, Object[] attributes) throws SQLExcep | |||
public Array createArrayOf(String typeName, Object[] elements) throws SQLException | |||
{ | |||
checkClosed(); | |||
int oid = getTypeInfo().getPGArrayType(typeName); | |||
int oid = getTypeInfo().getPGArrayType(typeName.toLowerCase()); |
vlsi
Oct 14, 2015
Member
Why is this a part of "use UTF-8 instead of US-ASCII for initial encoding" PR?
Why is this a part of "use UTF-8 instead of US-ASCII for initial encoding" PR?
davecramer
Oct 14, 2015
Author
Member
It should not be..... my mistake. How do you create two different PR's without applying the first PR ?
It should not be..... my mistake. How do you create two different PR's without applying the first PR ?
vlsi
Oct 14, 2015
Member
You should use different branches for different PRs.
It is not recommended to create PRs out of a master branch.
In other words, you create a branch for "default encoding" and a branch for "name case".
In present situation it would be easier to just git reset --hard 8dae0ae5df6ffaa484d0d6ff69aaa33f5d1d713b && git push -f origin master
. This will update PR with to have just a single commit, then you could merge it in.
You should use different branches for different PRs.
It is not recommended to create PRs out of a master branch.
In other words, you create a branch for "default encoding" and a branch for "name case".
In present situation it would be easier to just git reset --hard 8dae0ae5df6ffaa484d0d6ff69aaa33f5d1d713b && git push -f origin master
. This will update PR with to have just a single commit, then you could merge it in.
davecramer
Oct 14, 2015
Author
Member
wouldn't I push to my repo instead of master ?
Dave Cramer
On 14 October 2015 at 06:53, Vladimir Sitnikov notifications@github.com
wrote:
In org/postgresql/jdbc4/AbstractJdbc4Connection.java
#398 (comment):
@@ -99,7 +99,7 @@ public Struct createStruct(String typeName, Object[] attributes) throws SQLExcep
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
{
checkClosed();
-
int oid = getTypeInfo().getPGArrayType(typeName);
-
int oid = getTypeInfo().getPGArrayType(typeName.toLowerCase());
You should use different branches for different PRs.
It is not recommended to create PRs out of a master branch.
In other words, you create a branch for "default encoding" and a branch
for "name case".
In present situation it would be easier to just git reset --hard
8dae0ae && git push -f origin master.
This will update PR with to have just a single commit, then you could merge
it in.
—
Reply to this email directly or view it on GitHub
https://github.com/pgjdbc/pgjdbc/pull/398/files#r41979375.
wouldn't I push to my repo instead of master ?
Dave Cramer
On 14 October 2015 at 06:53, Vladimir Sitnikov notifications@github.com
wrote:
In org/postgresql/jdbc4/AbstractJdbc4Connection.java
#398 (comment):@@ -99,7 +99,7 @@ public Struct createStruct(String typeName, Object[] attributes) throws SQLExcep
public Array createArrayOf(String typeName, Object[] elements) throws SQLException
{
checkClosed();
int oid = getTypeInfo().getPGArrayType(typeName);
int oid = getTypeInfo().getPGArrayType(typeName.toLowerCase());
You should use different branches for different PRs.
It is not recommended to create PRs out of a master branch.
In other words, you create a branch for "default encoding" and a branch
for "name case".In present situation it would be easier to just git reset --hard
8dae0ae && git push -f origin master.
This will update PR with to have just a single commit, then you could merge
it in.—
Reply to this email directly or view it on GitHub
https://github.com/pgjdbc/pgjdbc/pull/398/files#r41979375.
vlsi
Oct 14, 2015
Member
I did not notice you create PRs from your own repository.
Then you should push to your repo.
I did not notice you create PRs from your own repository.
Then you should push to your repo.
fix: use UTF-8 instead of US-ASCII for initial encoding
Hi! I have something to say about this commit. org.postgresql.util.PSQLException: ошибка при попытке подсоединения. The problem not solved even if we explicitly set the charset for connection parameter. The environments settings was Russian_CP1251. Do not take as rudeness! English is not my native language. |
Sounds like we have a catch-22 if we use US-ASCII then we will break UTF-8 and vice-versa ? |
Something like that. |
I wonder if we can implement the following:
|
Can we read encoding settings from cluster (lc_messages) as initial operations and then use it to decode messages from server? |
It's tough and error-prone operations to find encoding (more statistical predictions than plain rules). For example ANSI and OEM ecnodings will accept any sequence of bytes without worying about gobbledigook in result string. UTF-8 will accept message from any server settings if only english letters appears, but will be unable to read if sequence of bytes appeared to be broken multibyte sequence for symbol. |
Also I see error that driver are not using charset option from connection parameters when establishing first initial connection to DB. |
If lc_messages is set to a language which uses UTF-8 then connections which fail garble messages