Charset and encoding 
Author Message
 Charset and encoding

Hello,

    I have defined a database with the encoding SQL_ASCII. I fill the
database by using embedded SQL. When I insert the value "Se?ales", it is
correctly inserted. I read the correct value by typing the query in
postgres, but when I access this database from a Java program, via JDBC,
I obtain the value "Seqales". The LANG variable is set to "es_ES"
(spanish) which I suppose is OK.

    I have changed this database encoding to LATIN1 and set the client
characterset to LATIN1 by typing  \encoding LATIN1.

    Now when I access the data from postgres interface I obtain
"Se(82f1)ales", and when I get the value through the Java program, I
obtain
"Se ?ales".

    Does anybody knows what is happening? Where can I find information
about this?
    Thanks in advance,
    Rosa M. Carro

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command



Sun, 26 Oct 2003 18:55:53 GMT
 Charset and encoding

Quote:
>     I have defined a database with the encoding SQL_ASCII. I fill the
> database by using embedded SQL. When I insert the value "Se?ales", it is
> correctly inserted. I read the correct value by typing the query in
> postgres, but when I access this database from a Java program, via JDBC,
> I obtain the value "Seqales". The LANG variable is set to "es_ES"
> (spanish) which I suppose is OK.

>     I have changed this database encoding to LATIN1 and set the client
> characterset to LATIN1 by typing  \encoding LATIN1.

>     Now when I access the data from postgres interface I obtain
> "Se(82f1)ales", and when I get the value through the Java program, I
> obtain
> "Se ?ales".

>     Does anybody knows what is happening? Where can I find information
> about this?
>     Thanks in advance,
>     Rosa M. Carro

(82f1) is 0x82 (leading character for LATIN2) + 0xf1 (Spanish 'n'),
that is the intermediate representation in the backend when the
encoding translatin is necessary. My guess is you set the database
encoding to LATIN2, not LATIN1. Can you show me the result of the
query:

select * from pg_database;
--
Tatsuo Ishii

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html



Sun, 26 Oct 2003 20:06:21 GMT
 Charset and encoding

datname   datdba    encoding    datpath
------------------------------------------------
courses      26                  7      courses

I have tested with LATIN1 - LATIN5 and I haven't got any result...
I'd need the Spanish '?' (that is what I insert)...
Maybe I need to insert this character in a special way? The client is
set to the same encoding as the database is.

Thanks,
Rosa M. Carro

P.S. Could it be related to multibyte (or something similar)?

Quote:

> >     I have defined a database with the encoding SQL_ASCII. I fill the
> > database by using embedded SQL. When I insert the value "Se?ales", it is
> > correctly inserted. I read the correct value by typing the query in
> > postgres, but when I access this database from a Java program, via JDBC,
> > I obtain the value "Seqales". The LANG variable is set to "es_ES"
> > (spanish) which I suppose is OK.

> >     I have changed this database encoding to LATIN1 and set the client
> > characterset to LATIN1 by typing  \encoding LATIN1.

> >     Now when I access the data from postgres interface I obtain
> > "Se(82f1)ales", and when I get the value through the Java program, I
> > obtain
> > "Se ?ales".

> >     Does anybody knows what is happening? Where can I find information
> > about this?
> >     Thanks in advance,
> >     Rosa M. Carro

> (82f1) is 0x82 (leading character for LATIN2) + 0xf1 (Spanish 'n'), that is
> the intermediate representation in the backend when the encoding translatin
> is necessary. My guess is you set the database encoding to LATIN2, not
> LATIN1. Can you show me the result of the query:

> select * from pg_database;
> --
> Tatsuo Ishii

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Sun, 26 Oct 2003 21:36:36 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Charset and encoding

2. Charset and encoding

3. ODBC - charset encoding

4. encoding charset=UTF-16 and xml update

5. charset, encoding, language

6. charset encoding problem

7. Charset encoding and accents

8. How can I translate Oracle WE8DEC charset to JAVA ISO-8895-1 or other charset correctly

9. How to solve Client Charset differing from server charset

10. Character Encoding WAS: ArrayIndexOutOfBoundsException in Encoding.decodeUTF8()

11. pgsql/contrib/pgcrypto encode.c encode.h

12. v7.3 : \encoding doesn't show changes in client encoding that are not done with \encoding itself (i.e. set names/set client_encoding)


 
Powered by phpBB® Forum Software