pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedUTF8 Vs Latin9 and valid encoding.
3+ messages / 2 participants
[nested] [flat]
* UTF8 Vs Latin9 and valid encoding.
@ 2006-08-30 04:48 Marcelo . <wachaca@yahoo.com>
2006-08-30 08:26 ` Re: UTF8 Vs Latin9 and valid encoding. Markus Schaber <schabi@logix-tt.com>
0 siblings, 1 reply; 3+ messages in thread
From: Marcelo . @ 2006-08-30 04:48 UTC (permalink / raw)
To: pgsql-sql
Hello,
I am using postgres 8.1 for windows and have the
following dilema.
I have 2 databases, one encoded in UTF-8 and one in
Latin9.
In both DBs I can create the following test table:
CREATE TABLE "holaniño"
(
nombre varchar(5),
"titúlo" varchar(10)
)
WITHOUT OIDS;
Then in both DBs I can execute the following SQL:
select * from holaniño where titúlo = 'compania'
HOWEVER, when I change the SQL to:
select * from holaniño where titúlo = "compañia"
(changed the N to a Ñ in the filter)
I receive the error msg:
ERROR: invalid UTF-8 byte sequence detected near byte
0xf1
Where in the LATIN9 db, there is no problem.
Isn't UTF-8 the same as UNICODE where it encapsulates
all other coding schemes including latin9?
Any insight would be greatly apreciated.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: UTF8 Vs Latin9 and valid encoding.
2006-08-30 04:48 UTF8 Vs Latin9 and valid encoding. Marcelo . <wachaca@yahoo.com>
@ 2006-08-30 08:26 ` Markus Schaber <schabi@logix-tt.com>
2006-08-30 13:52 ` Re: UTF8 Vs Latin9 and valid encoding. Marcelo . <wachaca@yahoo.com>
0 siblings, 1 reply; 3+ messages in thread
From: Markus Schaber @ 2006-08-30 08:26 UTC (permalink / raw)
To: pgsql-sql
Hi, Marcelo,
Marcelo . wrote:
> I receive the error msg:
> ERROR: invalid UTF-8 byte sequence detected near byte
> 0xf1
>
> Isn't UTF-8 the same as UNICODE where it encapsulates
> all other coding schemes including latin9?
Yes, it is.
But it seems that your client and the server disagree on the encoding
they use.
I think the problem is that your client (psql, I presume) uses latin9 to
communicate with the server, but the server assumes the client uses utf8.
in psql, you can use \encoding to show the encoding psql uses, and "show
client_encoding;" to show the encoding the server thinks the client uses.
Try one of:
SET client_encoding TO LATIN9; -- Tell server: client uses latin9
\encoding LATIN9; -- Set clients encoding
You can also set UTF-8 here, the server will convert between the client
and database encoding (but it needs to know).
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: UTF8 Vs Latin9 and valid encoding.
2006-08-30 04:48 UTF8 Vs Latin9 and valid encoding. Marcelo . <wachaca@yahoo.com>
2006-08-30 08:26 ` Re: UTF8 Vs Latin9 and valid encoding. Markus Schaber <schabi@logix-tt.com>
@ 2006-08-30 13:52 ` Marcelo . <wachaca@yahoo.com>
0 siblings, 0 replies; 3+ messages in thread
From: Marcelo . @ 2006-08-30 13:52 UTC (permalink / raw)
To: pgsql-sql
Hello,
Thanks for your reply.
When I execute
show client_encoding;
I get UNICODE.
However, up to know I was using pgAdmin III Query and
EMS... you gave me the idea to use psql, where I
noticed something interesting:
\encoding
UTF8
show client_encoding;
UTF8
So this seems to be OK..
However when I type áéíóúñ on screen I see ߨ«·±
Why would this be?
Thanks again
--- Markus Schaber <schabi@logix-tt.com> wrote:
> Hi, Marcelo,
>
> Marcelo . wrote:
>
> > I receive the error msg:
> > ERROR: invalid UTF-8 byte sequence detected near
> byte
> > 0xf1
> >
> > Isn't UTF-8 the same as UNICODE where it
> encapsulates
> > all other coding schemes including latin9?
>
> Yes, it is.
>
> But it seems that your client and the server
> disagree on the encoding
> they use.
>
> I think the problem is that your client (psql, I
> presume) uses latin9 to
> communicate with the server, but the server assumes
> the client uses utf8.
>
> in psql, you can use \encoding to show the encoding
> psql uses, and "show
> client_encoding;" to show the encoding the server
> thinks the client uses.
>
> Try one of:
>
> SET client_encoding TO LATIN9; -- Tell server:
> client uses latin9
>
> \encoding LATIN9; -- Set clients encoding
>
> You can also set UTF-8 here, the server will convert
> between the client
> and database encoding (but it needs to know).
>
> HTH,
> Markus
>
>
>
> --
> Markus Schaber | Logical Tracking&Tracing
> International AG
> Dipl. Inf. | Software Development GIS
>
> Fight against software patents in EU! www.ffii.org
> www.nosoftwarepatents.org
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please
> send an appropriate
> subscribe-nomail command to
> majordomo@postgresql.org so that your
> message can get through to the mailing list
> cleanly
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2006-08-30 13:52 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-08-30 04:48 UTF8 Vs Latin9 and valid encoding. Marcelo . <wachaca@yahoo.com>
2006-08-30 08:26 ` Markus Schaber <schabi@logix-tt.com>
2006-08-30 13:52 ` Marcelo . <wachaca@yahoo.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox