Conversion on the fly from KOI8-R to WIN1251 is invalid

Started by Roman A.Grigorovichabout 23 years ago2 messagesbugs
Jump to latest
#1Roman A.Grigorovich
atz@atz.msk.ru

CREATE DATABASE TEST WITH ENCODING = 'KOI8';
CREATE TABLE TEST (LOGIN VARCHAR);

SET CLIENT_ENCODING 'KOI8';

INSERT INTO TEST (LOGIN) VALUES ('\206pesto\206');

SELECT LOGIN FROM TEST;
It's return string '†pesto†';

Then i try
SET CLIENT_ENCODING = 'WIN';

SELECT LOGIN FROM TEST;
It's return string 'pesto '

The code of last char in this string (in decimals) is 32 (space).
Why? Where the chars with code 206 (in octal) ?
Is this bug?

#2Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: Roman A.Grigorovich (#1)
Re: Conversion on the fly from KOI8-R to WIN1251 is invalid

CREATE DATABASE TEST WITH ENCODING = 'KOI8';
CREATE TABLE TEST (LOGIN VARCHAR);

SET CLIENT_ENCODING 'KOI8';

INSERT INTO TEST (LOGIN) VALUES ('\206pesto\206');

SELECT LOGIN FROM TEST;
It's return string '���pesto���';

Then i try
SET CLIENT_ENCODING = 'WIN';

SELECT LOGIN FROM TEST;
It's return string 'pesto '

The code of last char in this string (in decimals) is 32 (space).
Why? Where the chars with code 206 (in octal) ?
Is this bug?

What is your PostgreSQL version?
--
Tatsuo Ishii