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

From Andriy Tkachuk
Subject Re: about contrib/dbase/dbf.c (fwd): conversion of non-ascii dbf
Date
Msg-id 20030829155954.C75739-100000@pool.imt.com.ua
Whole thread Raw
Responses Re: about contrib/dbase/dbf.c (fwd): conversion of non-ascii
List pgsql-patches
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@candle.pha.pa.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



pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: gettext-related compile failure fix
Next
From: Database Administrator
Date:
Subject: 7.4beta2 initdb Fix