Re: about contrib/dbase/dbf.c (fwd): conversion of non-ascii

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andriy Tkachuk <ant(at)imt(dot)com(dot)ua>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: about contrib/dbase/dbf.c (fwd): conversion of non-ascii
Date: 2003-09-10 00:33:11
Message-ID: 200309100033.h8A0XBo17455@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


I already applied your DBF patch, but I just found a cleaner way ---
patch attached and applied.

---------------------------------------------------------------------------

Andriy Tkachuk wrote:
> Hi folks.
>
> I suppose, that Bruse was busy to answer on my last mail on this topic.
> But I love, when something work rather then it do not :)
>
> What do you think about this little patch?
>
> Sorry if i put this msg into wrong list, but i didn't find
> more appropriate for this contrib. I will be appreciate if
> you put me into right one.
>
> Thanks,
> Andriy.
>
> http://www.imt.com.ua
>
> ---------- Forwarded message ----------
>
> The code above skips anything but chars between 0x21 and 0x7E.
> My dbf have cyrillic charset, so any filds, that doesn't end on "." (dot)
> are truncated. Moreover "chars between 0x21 and 0x7E" means, that
> dbf2pg is not working for not ascii charset unless string ends on
> some ascii symbol, usually punctuation.
>
> What else than isspace one must skip (trim) in 'C' (char) field in dbf?
>
> On Thu, 24 Jul 2003, Bruce Momjian wrote:
>
> >
> > Can we assume anything in that range is a space? There must be a better
> > way.
> >
> >
> > ---------------------------------------------------------------------------
> >
> > Andriy Tkachuk wrote:
> > > Bruse, what about this:
> > >
> > > Index: contrib/dbase/dbf.c
> > > ===================================================================
> > > RCS file: /projects/cvsroot/pgsql-server/contrib/dbase/dbf.c,v
> > > retrieving revision 1.5
> > > diff -r1.5 dbf.c
> > > 337c337
> > > < while ((i > 0) && ((*end < 0x21) || (*end > 0x7E)))
> > > ---
> > > > while ((i > 0) && isspace(*end))
> > >
> > > it fixes an bug for me with cyrillic conversion.
> > >
> > > Thanks,
> > > Andriy.
> > >
> > >
> >
> > --
> > Bruce Momjian | http://candle.pha.pa.us
> > pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> > + If your life is a hard drive, | 13 Roberts Road
> > + Christ can be your backup. | Newtown Square, Pennsylvania 19073
> >
>
> --
> Because strait is the gate, and narrow is the way, which leadeth unto
> life, and few there be that find it. (MAT 7:14)
> Ask, and it shall be given you; seek, and ye shall find;
> knock, and it shall be opened unto you... (MAT 7:7)
>
> ANT17-RIPE
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 981 bytes

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2003-09-10 02:32:20 Re: 7.4beta2 initdb Fix
Previous Message Bruce Momjian 2003-09-09 17:53:26 Re: Minor lmgr code cleanup