Skip site navigation (1) Skip section navigation (2)

Re: UTF-8 encoding failure

From: Martin Schäfer <Martin(dot)Schaefer(at)cadcorp(dot)com>
To: 'Hiroshi Saito' <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, 'Takahiro Itagaki'<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: UTF-8 encoding failure
Date: 2010-03-26 14:21:21
Message-ID: 11A8567A97B15648846060F5CD818EB840FF19F7EB@DEV001EX.Dev.cadcorp.net (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello Hiroshi-san,

The only differences I found between my source file and yours are the file encoding (Unicode/SJIS), different #include-s and different parameters to PQsetdblogin. I had to undo the last two changes to compile and run on my machine. And the changed file encoding made no difference. It still fails on my machine.

Regards,

Martin

> -----Original Message-----
> From: Hiroshi Saito [mailto:z-saito(at)guitar(dot)ocn(dot)ne(dot)jp] 
> Sent: Friday, March 26, 2010 2:58 PM
> To: Martin Schäfer; 'Takahiro Itagaki'
> Cc: pgsql-bugs(at)postgresql(dot)org
> Subject: Re: [BUGS] UTF-8 encoding failure
> 
> Hi Martin-san.
> 
> Umm, I sent what corrected some of your TestPostgreSQLJapanese.cpp.
> http://archives.postgresql.org/pgsql-bugs/2010-03/msg00188.php
> Did you use it?
> 
> Regards,
> Hiroshi Saito
> 
> ----- Original Message -----
> From: "Martin Schäfer" <Martin(dot)Schaefer(at)cadcorp(dot)com>
> 
> 
> > Unfortunately there are encoding problems on my machine. 
> I'm getting this output:
> >
> > Testing with encoding UTF-8:
> > PQfname(pResult, 4) returned incorrect field name.
> > PQfname(pResult, 5) returned incorrect field name.
> > PQfname(pResult, 6) returned incorrect field name.
> >
> > Testing with encoding SJIS:
> > Query failed with error:
> > ERROR:  invalid byte sequence for encoding "UTF8": 0xe59eff
> > HINT:  This error can also happen if the byte sequence does 
> not match the encoding 
> > expected by the server, which is controlled by "client_encoding".
> >
> > Instead of a Japanese OS, I used an English (UK) OS and set 
> the system locale to Japanese, 
> > but that should be good enough I think.
> > I also used a new install of PostgreSQL, with only the 
> PostGIS module added.
> >
> > Okay, I find it difficult to imagine that a bug like this 
> would not have been found 
> > before. But if it works fine on your machines, why doesn't 
> it work on my machine?
> >
> > Regards,
> >
> > Martin Schäfer
> > Principal Software Engineer
> > Cadcorp
> > Computer Aided Development Corporation Ltd.
> > 1 Heathcock Court, London, WC2R 0NT
> > martin(dot)schaefer(at)cadcorp(dot)com
> > www.cadcorp.com
> >
> >> -----Original Message-----
> >> From: Takahiro Itagaki [mailto:itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp]
> >> Sent: Friday, March 26, 2010 3:07 AM
> >> To: Martin Schäfer; Hiroshi Saito
> >> Cc: pgsql-bugs(at)postgresql(dot)org
> >> Subject: Re: [BUGS] UTF-8 encoding failure
> >>
> >> "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp> wrote:
> >> > Probably it is not a bug.
> >> >
> >> > Testing with encoding UTF-8:
> >> > NOTICE:  CREATE TABLE will create implicit sequence
> >> "蝗帛ョ誉gid_seq" for serial column "蝗帛ョ・gid"
> >> > Testing with encoding SJIS:
> >> > NOTICE:  CREATE TABLE will create implicit sequence
> >> "四宗_gid_seq" for serial column "四宗.gid"
> >>
> >> > From: "Martin Schafer" <Martin(dot)Schaefer(at)cadcorp(dot)com>
> >> > - UTF8: does not return the same column name used to create
> >> the table.
> >>
> >> Yeah, there are no encoding problems in libpq and postgres,
> >> but you need to print NOTICE messages in the same codepage
> >> with your console.
> >> You probably need to replace routines to display NOTICE
> >> messages in libpq.
> >> PQsetNoticeReceiver() would be a help.
> >>
> >> Or, you could just change the codepage of your console to UTF-8.
> >> However, there is a known problem in Windows console that 
> console with
> >> UTF-8 codepage cannot display any kanji characters. I'm not
> >> sure what we can do to fix it ... some font settings in 
> the registory?
> >>
> >> Regards,
> >> ---
> >> Takahiro Itagaki
> >> NTT Open Source Software Center
> >>
> >>
> >>
> >> 
> 
> 
****************************************************************************
This email is confidential and may be privileged and should not be used, read
or copied by anyone who is not the  original intended recipient. If you have
received this email in error  please inform the sender and delete it from
your mailbox or any other storage mechanism. Unless specifically stated,
nothing in this email constitutes an offer by Cadcorp and Cadcorp does not
warrant that any information contained in this email is accurate.
Cadcorp cannot accept liability for any statements made which are clearly the
sender's own and not expressly made on behalf of Cadcorp or one of its agents.
Please rely on your own virus check. No responsibility is taken by Cadcorp
for any damage arising out of any bug or virus infection.
****************************************************************************

In response to

Responses

pgsql-bugs by date

Next:From: Alan McKayDate: 2010-03-26 14:32:53
Subject: Solid State Drives with PG (was: in RAM DB)
Previous:From: Hiroshi SaitoDate: 2010-03-26 13:57:58
Subject: Re: UTF-8 encoding failure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group