Compare chinese words

Started by oclamover 23 years ago3 messagesgeneral
Jump to latest
#1oclam
oc.lam@innoage.com

Hi,

I'm a new user of PostgreSQL. I wrote the following statement to compare 2 Chinese words if they are the same :

SELECT '黃'='李';

(
For those who cannot read Chinese, can use the following statement :
SELECT (chr(182) || chr(192))=(chr(167) || chr(245));
)

I expected it will return false to me, but it return true.
Can anyone help me to solve this? Thx.

oclam

#2oclam
oc.lam@innoage.com
In reply to: oclam (#1)
Re: Compare chinese words

Is there anything needed to be set in the database?

The database return TRUE when I execute the following statement :
SELECT chr(182)=chr(167);

But it return FALSE if I changed the statement to:
SELECT chr(182)=chr(100);

I've try to change the database encoding to 'EUC_TW', 'LATIN1', and 'WIN'. However, the problem still exists.
Any suggestion on what I can do?
----- Original Message -----
From: wlj
To: oclam
Sent: Wednesday, September 11, 2002 9:16 AM
Subject: Re: [GENERAL] Compare chinese words

i try it in japanese,i got the result that you wanted.
----- Original Message -----
From: oclam
To: pgsql-general@postgresql.org
Sent: Tuesday, September 10, 2002 1:46 PM
Subject: [GENERAL] Compare chinese words

Hi,

I'm a new user of PostgreSQL. I wrote the following statement to compare 2 Chinese words if they are the same :

SELECT '黃'='李';

(
For those who cannot read Chinese, can use the following statement :
SELECT (chr(182) || chr(192))=(chr(167) || chr(245));
)

I expected it will return false to me, but it return true.
Can anyone help me to solve this? Thx.

oclam

#3oclam
oc.lam@innoage.com
In reply to: oclam (#1)
Re: Compare chinese words

Here is the info.
postgres (PostgreSQL) 7.2.2
Red Hat Linux release 7.2

what is the version of your postgres and your operating system??
Is there anything needed to be set in the database?

The database return TRUE when I execute the following statement :
SELECT chr(182)=chr(167);

But it return FALSE if I changed the statement to:
SELECT chr(182)=chr(100);

I've try to change the database encoding to 'EUC_TW', 'LATIN1', and 'WIN'. However, the problem still exists.
Any suggestion on what I can do?
i try it in japanese,i got the result that you wanted.
Hi,

I'm a new user of PostgreSQL. I wrote the following statement to compare 2 Chinese words if they are the same :

SELECT '黃'='李';

(
For those who cannot read Chinese, can use the following statement :
SELECT (chr(182) || chr(192))=(chr(167) || chr(245));
)

I expected it will return false to me, but it return true.
Can anyone help me to solve this? Thx.

oclam