Обсуждение: problem with spanish characters

Поиск
Список
Период
Сортировка

problem with spanish characters

От
"Freddy Villalba Arias"
Дата:

Hello everybody,

 

I’m not sure if this is a bug on the upper/lower command or anywhere else.

 

This is the problem:

 

 

I have a DB that uses ‘UNICODE’ encoding. PostgreSQL version is 7.4.2.

 

 

I have a field that holds characters, including characters like ‘Ñ’ (lowercase version is ‘ñ’). The name of the field is ‘ccaa_ds_ccaa’ (table name is ‘ccaa’).

 

 

When I execute the following SQL statement:

 

select * from ccaa where ccaa_ds_ccaa like '%Ñ%'

 

.. it returns one record (that’s the correct result). There is only one record that matches this criteria (the actual value is ‘CATALUÑA’).

 

However, if I execute this one:

 

select * from ccaa where lower(ccaa_ds_ccaa) like '%Ñ%'

 

… it returns the very same record, which is WRONG, since the “lower” should make that query return no matching records.

 

Similarly, I tried this:

 

select * from ccaa where upper(ccaa_ds_ccaa) like upper(%ñ%')

 

… and IT DOES NOT RETURN ANY MATCHING RECORDS (it should return the same record return by the previous query).

 

 

It seems like the upper / lower commands do not work properly on UNICODE.

 

 

I tested this using ‘LATIN9’ encoding an it works properly in all cases.

 

 

Is this a known bug? Is there a bug fix for it? Where can I find it?

 

What effect does using UNICODE / LATIN9 on BLOB fields (bytea)?  (I believe there are issues with the JDBC drivers)

 

Regards,

Freddy.

Re: [JDBC] problem with spanish characters

От
nahum castro
Дата:
 --- Freddy Villalba Arias
<fvillalba@madrid.bilbomatica.es> escribió: > Hello
everybody,
> 
>  
> 
> I'm not sure if this is a bug on the upper/lower
> command or anywhere else.
> 
>  
> 
> This is the problem:
> 
>  
> 
>  
> 
> I have a DB that uses 'UNICODE' encoding. PostgreSQL
> version is 7.4.2.
> 
>  
> 
>  
> 
> I have a field that holds characters, including
> characters like 'Ñ' (lowercase version is 'ñ'). The
> name of the field is 'ccaa_ds_ccaa' (table name is
> 'ccaa').
> 
Hola Freddy, he encontrado el mismo problema con psql,
ni sisquiera me permite insertar caracteres con Ñ en  
bases de datos UNICODE.

Siempre he usado LATIN1 para mis bases de datos, lo
que parece ser el problema es el la codificación del
sistema operativo, en Fedora Core 1 en mi archivo
quite las referncias a UTF-8 o UNICODE en mi archivo
/etc/sysconfig/i18n
LANG="es_MX"
SUPPORTED="es_MX:es"
SYSFONT="latarcyrheb-sun16"

Me entro la duda e hice una prueba creando una tabla
con codificación UNICODE y tengo unos resultados
extraños:

Primero no puedo insertar datos con Ñ o ñ, 

enes=# insert into enes(nombre) values('CATALUÑA');
ERROR:  secuencia de bytes no válida para codificación
"UNICODE": 0xd141

Pero con LATIN1 nunca he tenido este problema

Segundo no puedo obtener el describe de la base de
datos:

enes=# \d
ERROR:  secuencia de bytes no válida para codificación
"UNICODE": 0xed6e64

Voy a hacer la prueba con el archivo(fichero) i18n en
codificación UTF-8 y luego te digo que paso.

Nota: el postgres lo instale con RPMS, voy a tratar
tambien con el compilado del codigo fuente.

Saludos desde México.

=====
--
Nahum Castro
Leon, Guanajuato, Mexico
e-mail: pedro1_72 at yahoo dot com

_________________________________________________________
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx