From: ljb <ljb220@mindspring.com>
To: pgsql-interfaces@postgresql.org
Subject: Re: Problem With TCL
Date: Mon, 1 Aug 2005 02:21:13 +0000 (UTC)
Message-ID: <dck0uo$dpr$1@news.hub.org> (raw)
References: <BAY7-F2302527EC9AE2E769D2BD3FCC00@phx.gbl>
rev0ltz@hotmail.com wrote:
> ...
> I thought it was working fine, until I tryed to find information about a
> channel called #espa?a. For our surprise the bot told "No records found for
> #espa?a". So I got curious and made other tests... it doesn't works for any
> channels with chars like ? in the name.
> ...
>
> Well... another interesting notes: I can see information about that kind of
> channel name using a third part PHP nterface. Current server encoding is
> 'SQL_ASCII'. (I'm not familiar with that... but some guys told that it may
> be usefull).
Two possible causes come to mind. Hope this helps.
(1) If your database encoding is SQL_ASCII, you will have problems storing
and retrieving non-ASCII characters from CHAR, VARCHAR, and TEXT fields.
Your database encoding should be something more appropriate to your locale,
perhaps "Latin1" or "UNICODE". This is especially important with Tcl
interfaces, which send and expect UTF-8 (Unicode) encoded characters
to/from PostgreSQL. PostgreSQL will handle the conversion between Tcl and
your database encoding, unless the database encoding is SQL_ASCII.
(2) You have:
set query [pg_exec $conexao "SELECT * FROM channels WHERE \
lower(name)='[string tolower [lindex $rest 0]]'";]
It would be nice to think that SQL lower() gives the same results as Tcl's
[string tolower] on non-ASCII characters, but I am a skeptic, and would
want to prove it with some tests. Perhaps it does work, but only if the
database encoding is right. Or maybe it is better not to mix server-side
and client-side case mangling.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: ljb220@mindspring.com
Subject: Re: Problem With TCL
In-Reply-To: <dck0uo$dpr$1@news.hub.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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