Skip site navigation (1) Skip section navigation (2)

Re: Problem with accessing Russian UTF database

From: "Ronald Vyhmeister" <rvyhmeister(at)aiias(dot)edu>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problem with accessing Russian UTF database
Date: 2008-11-26 07:13:18
Message-ID: 9CD162E55FEF4D78A89E1D00BDB1EE0D@peregrino (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Oliver and all,

I see that there is a Java problem...  I limited my code to this:

<%@ page import="java.util.*" %>

	Locale locale = Locale.getDefault();
	locale = new Locale("ru", "RU");
	String someString =  'фывфывафыва';
	char[] rawCharacters = someString.toCharArray();
	for (int i = 0; i < rawCharacters.length; ++i)
		System.out.println("#" + i + " = " +

And tomcat cannot handle the string

An error occurred at line: 2 in the jsp file: /iutus/unicode.jsp
Invalid character constant
1: <%@ page import="java.util.*" %>
2: <%
4: 	Locale locale = Locale.getDefault();
5: 	locale = new Locale("ru", "RU");

If I replace the String statement with this:

String someString =  'ф';

The error changes to:

Type mismatch: cannot convert from char to String

So I thought I'd be smart and just define it as a char variable, but now it

Invalid character constant

So I've just done them one at a time for 5 characters:

ф = f4 
ы = fb 
в = e2 
ц = f6 
л = eb

It would appear to me that whatever I'm entering is NOT Unicode... so how do
I force Windows/Linux/Mac to use Unicode for input/output?  I'm trying to
deal with an inherited app... and I'm no java guru...


In response to


pgsql-jdbc by date

Next:From: Ronald VyhmeisterDate: 2008-11-26 07:33:06
Subject: Re: Problem with accessing Russian UTF database
Previous:From: Oliver JowettDate: 2008-11-26 00:21:58
Subject: Re: Problem with accessing Russian UTF database

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group