[lug] OT: Saving Greek in Postgresql

D. Stimits stimits at idcomm.com
Wed Apr 10 04:00:22 MDT 2002


John Starkey wrote:
> 
> Anyone familiar with saving Greek chars in Postgres?
> 
> I've got multibyte and unicode-conversion enabled and sending data to
> the DB using PHP. It's coming from a simple HTML form. No matter what I
> do, I end up with gibberish in the DB. I've tried it with
> client_encoding = ASCII, and client_encoding = UNICODE. I've also tried
> encoding it utf-8 before the insert command, and still no luck.

I would have to ask if PHP is presenting it as a byte stream or truly as
wide characters, 16 bits in size? I don't know PHP, but I suspect in a
weakly typed script language, you are running a risk of 16 bit character
sets being interpreted one byte at a time (and then stored typecast into
a 16 bit slot). Are you positive that the data being seen by postgresql
is being present in such a way that there is no need to merge low and
high order bytes? Considering most frontends to postgresql are C or C++
based at some level in the API, there is a chance of type conversions
going on that you don't know about.

D. Stimits, stimits at idcomm.com

> 
> TIA,
> 
> John
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list