Re: UTF-8 Problem ?

From: Thomas Beutin <psql(at)laokoon(dot)IN-Berlin(dot)DE>
To: pgsql-sql(at)postgresql(dot)org
Cc: Milen Kulev <makulev(at)gmx(dot)net>
Subject: Re: UTF-8 Problem ?
Date: 2006-06-15 13:33:55
Message-ID: 449161C3.9080601@laokoon.IN-Berlin.DE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Milen,

Milen Kulev wrote:
> What actually the compile option --enable-recode is doing ?
IIRC it enables the support for string recoding, but this might not be
correct anymore ...

> I haven't compiled PG with this option for sure (perhaps is the option
> On by defalt ?), but oyu advice hepled me:
[...]
You're welcome :)

Regards,
-tb

> -----Original Message-----
> From: Thomas Beutin [mailto:psql(at)laokoon(dot)IN-Berlin(dot)DE]
> Sent: Thursday, June 15, 2006 2:45 PM
> To: pgsql-sql(at)postgresql(dot)org
> Cc: Milen Kulev
> Subject: Re: [SQL] UTF-8 Problem ?
>
>
> Hi Milen,
>
> Milen Kulev wrote:
>> Hi Listers,
>> I want to insert some german specific characters (umlaut characters)
>> into a table, but I am getting the following
>> Error message:
>> postgres=# EXECUTE stmt (1, 1 , 1 , 'Grün') ;
>> ERROR: invalid UTF-8 byte sequence detected near byte 0xfc
>>
>> Or
>>
>> postgres=# EXECUTE stmt (1, 1 , 1 , 'MAßßtab') ;
>> ERROR: invalid UTF-8 byte sequence detected near byte 0xdf
>>
>> Here are my object/statement definitions :
>>
>> A) PREPARE stmt( int, int, int, varchar) as insert INTO part values
>> ($1,$2,$3,$4);
>>
>> B)
>> postgres=# \d+ part
>> Table "public.part"
>> Column | Type | Modifiers | Description
>> --------+------------------------+-----------+-------------
>> id1 | integer | not null |
>> id2 | integer | not null |
>> id3 | integer | not null |
>> filler | character varying(200) | |
>>
>> C)
>>
>> postgres=# l\l
>> List of databases
>> Name | Owner | Encoding
>> ------------+-------+-----------
>> db1 | user1 | SQL_ASCII
>> postgres | pg | UTF8
>> template0 | pg | UTF8
>> template1 | pg | UTF8
>>
>>
>> How to solve my problem ?
>
> You should insert only correct utf8 strings or set the client encoding
> correctly:
> SET client_encoding = 'LATIN1';
> or
> SET client_encoding = 'LATIN9';
>
> IIRC postgresql must be compiled with --enable-recode to support this.
>
> Regards,
> -tb
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2006-06-15 13:42:08 Re: UTF-8 Problem ?
Previous Message Milen Kulev 2006-06-15 12:59:53 Re: UTF-8 Problem ?