[lug] OT: Saving Greek in Postgresql

rm at fabula.de rm at fabula.de
Wed Apr 10 07:00:16 MDT 2002


On Wed, Apr 10, 2002 at 04:00:22AM -0600, D. Stimits wrote:
> 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.

Might be an awfully silly question, but how is the encoding of the HTML
input form set?

I'd also second D. doubts about PHP's type safeness.
Could you look at a dump of your request when it comes in to see how
the data actually is encoded (i use tcpdump/ethereal for that)?


 Ralf

> 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
> _______________________________________________
> 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