[Seaside] 3.9 and encoding

Norbert Hartl norbert at hartl.name
Wed Feb 28 11:43:02 UTC 2007


On Wed, 2007-02-28 at 12:25 +0100, radoslav hodnicak wrote:
> 
> On Wed, 28 Feb 2007, Norbert Hartl wrote:
> 
> >> If you run WAKomEncoded39 on Squeak 3.9 you will have strings with
> >> (new) Squeak encoding in your image which is basically non-unified
> >> unicode. For latin-1 characters this will be indistinguishable from
> >> latin-1. If your database is utf-8 you need to encode your strings to
> >> utf-8 when writing them to your database and decode your strings from
> >> utf-8 when reading from the database (only to convert it back to utf-8
> >> when generating html). You can configure the PostgreS database driver
> >> to do this automatically for you.
> >>
> > Oh, this seems quite easy. But I didn't found anything to configure
> > in the Postgres driver. Do you have any hint?
> 
> Postgres supports communication with in various encodings, you can tell it 
> what encoding are you using with the sql command
> 
> SET CLIENT_ENCODING TO "encoding here";
> 
> look in postgres docs for all supported encodings
> 
Yes, but I doubt it supports the "non-unified unicode" encoding
which the squeak strings are made off :) Btw. I really like to
have utf-8 encoding. It is a good way to have a "common" way to
do these things. So this way round I need a way to convert it that 
way.

I think the postgres driver should be capable of:

- If the driver is requested to do a specific format the driver
  should try to negotiate that with the database
- If the driver is not requested to use a specific format the
  database driver should be capable of converting data in the
  encoding the database is using.
- Or alternatively if no encoding is requested the driver may use
  a "default" encoding which is known to be supported on the database
  side as well as on the squeak side so that conversion can take
  place.

But I don't know which effects client encoding has ater all. For me it
appears only as the communication encoding between client and database.
I assume I can have client encoding latin-1 and send a latin-1 string.
And if I send the same string as utf-8 in client encoding utf-8 it will
be the same string on the database side. Is this correct?

Norbert






More information about the Seaside mailing list