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

From: Andriy Tkachuk <ant(at)imt(dot)com(dot)ua>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: about contrib/dbase/dbf.c (fwd): conversion of non-ascii dbf
Date: 2003-08-29 13:12:13
Message-ID: 20030829155954.C75739-100000@pool.imt.com.ua
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(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

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Database Administrator 2003-08-29 20:59:46 7.4beta2 initdb Fix
Previous Message Tom Lane 2003-08-28 23:04:19 Re: New array functions