Strange UTF-8 behaviour

From: "Marco Ferretti" <marco(dot)ferretti(at)jrc(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Strange UTF-8 behaviour
Date: 2004-09-16 16:10:13
Message-ID: 4149BAE5.1060406@jrc.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<small><font face="Century Gothic">Hi there all. <br>
I am quite new to Postgres, so forgive me if this question seems
obvious. <br>
<br>
I have created a database with the UTF-8 encoding&nbsp; (createdb cassa
--encoding=UTF-8) .<br>
Then I have made the following tests :<br>
<br>
</font></small><small><font face="Century Gothic">cassa=&gt; </font></small><small><font
face="Century Gothic">create table test(id varchar(5));<br>
cassa=&gt; insert into test values ('12345');<br>
INSERT 178725 1<br>
cassa=&gt; insert into test values ('123&egrave;');<br>
INSERT 178726 1<br>
cassa=&gt; insert into test values ('1234&egrave;');<br>
ERROR:&nbsp; value too long for type character varying(5)<br>
<br>
<br>
but if I try <br>
cassa=&gt; select '#' || id || '#' from test;<br>
&nbsp;?column?<br>
----------<br>
&nbsp;#12345#<br>
&nbsp;#123&egrave;#<br>
(2 rows)<br>
<br>
<br>
so, apparently the chars are stored the rigth way (</font></small><small><font
face="Century Gothic"> #123&egrave;#) but when trying the query the &egrave; char is
parsed as&nbsp; 2 chars ....<br>
<br>
The database server version is 7.3.4 on a RedHat 9 machine ...<br>
<br>
Any clue ?<br>
<br>
Tia <br>
&nbsp;&nbsp;&nbsp; Marco<br>
</font></small><small><font face="Century Gothic"><br>
<br>
</font></small>
<pre class="moz-signature" cols="72">--
Ever noticed how fast windows run ? neither did I

</pre>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.6 KB

Responses

Browse pgsql-general by date

  From Date Subject
Next Message G. Thomas Yagel, Jr. 2004-09-16 16:17:43 Vacuum related question
Previous Message Alvaro Herrera 2004-09-16 15:59:04 Re: 8.0.0beta2 and plpgsql