Re: Problem with accessing Russian UTF database - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Problem with accessing Russian UTF database
Date
Msg-id 492C96A6.7020800@opencloud.com
Whole thread Raw
In response to Re: Problem with accessing Russian UTF database  ("Ronald Vyhmeister" <rvyhmeister@aiias.edu>)
Responses Re: Problem with accessing Russian UTF database  ("Ronald Vyhmeister" <rvyhmeister@aiias.edu>)
Re: Problem with accessing Russian UTF database  (Guillaume Cottenceau <gc@mnc.ch>)
List pgsql-jdbc
Ronald Vyhmeister wrote:

> As for the Unicode escapes, how do I determine them?

The syntax of a unicode escape in Java is \uNNNN where NNNN is the hex
value of the Unicode codepoint you want to use.

See http://unicode.org/charts/ to find the particular ones you need
(e.g. Cyrillic is in http://unicode.org/charts/PDF/U0400.pdf)

>> Also, as I suggested earlier, try examining your strings
>> character-by-character to check that they really contain the codepoints
>> you think they contain.
>
> Right now, the string I'm entering was from the keyboard, set to Russian mode (and yes, I've tried it from Linux and
Windows,and the results are the same). 

What I mean is to do something like this:

> String someString = /* whatever you want to inspect */;
> char[] rawCharacters = someString.toCharArray();
> for (int i = 0; i < rawCharacters.length; ++i)
>    System.out.println("#" + i + " = " + Integer.toHexString((int)rawCharacters[i]));

so that you can see exactly what the String really contains, not
whatever the combination of your output encoding & your terminal
encoding thinks it should look like. (Java strings are UCS-2/UTF-16
internally, which is a 1:1 mapping to Unicode codepoint values most of
the time, so the above code prints out unicode codepoint values in hex)

-O

pgsql-jdbc by date:

Previous
From: "Ronald Vyhmeister"
Date:
Subject: Re: Problem with accessing Russian UTF database
Next
From: "Ronald Vyhmeister"
Date:
Subject: Re: Problem with accessing Russian UTF database