[postgis-devel] Re: [Fwd: PostGIS : shp2pgsql i18n patch.]

strk at refractions.net strk at refractions.net
Sun Jan 16 08:44:49 PST 2005


Tetsushi, thanks for your great review.
I've changed utf8 encoder to allocate 3*strlen(original_string).

Also I've made escaping simpler and more robust (pointer based),
and removed leaking of escaped strings.

If you can give it a look now I would appreciate it.

--strk;

On Sat, Jan 15, 2005 at 05:49:55PM +0900, IIDA Tetsushi wrote:
> strk,
> I checked rc1 now. Please let me point some out.
> 
> the patch for explanation was placed.
> http://oi.nu/shp2pgsql/shp2pgsql.c.diff.txt
> 
> ---
> 1) a UTF8 buffer is too short.
> The single byte character that is not compatible with ASCII,
> it is mainly changed into a 3 bytes UTF8 character.
> 
> for example, in Shift_JIS, Single byte character 0x7e (overline)
> and The character of the range of 0xA1-0xDF (HALFWIDTH
> KATAKANA) is changed into a 3 bytes UTF-8 character.
> 
> sample shapefile -> http://oi.nu/shp2pgsql/kanashape.zip
> 
> 2) Escaping when both quote and backslash exist is not good.
> It is not processed even if a backslash is before the position
> in which the quote was found first.
> 
> # The reason which was being made pointer processing with the
> # original patch is this.
> 
> 3) #if USE_ICONV -> #ifdef USE_ICONV
>   at line 423.
> 
> --
> IIDA Tetsushi
> (mailto : Iida_Tetsushi at oi.nu)
> 
> 
> ----- Original Message ----- 
> From: <strk at refractions.net>
> To: "IIDA Tetsushi" <hogepiyo at nifty.com>; 
> <postgis-devel at postgis.refractions.net>; "Jeff Lounsbury" 
> <jeffloun at refractions.net>; "Paul Ramsey" <paul at refractions.net>
> Sent: Thursday, January 13, 2005 2:02 AM
> Subject: Re: [postgis-devel] Re: [Fwd: PostGIS : shp2pgsql i18n patch.]
> 
> 
> >Tetsushi, hackers,
> >I've added an optional support for UTF8 output in shp2pgsql.
> >To enable you have to set USE_ICONV to 1 in globale Makefile.config
> >or in the environment.
> >
> >It defaults to 0 for easy of testing and because other compiler/linker
> >flags might be needed in that case (I don't need -liconv on my host,
> >your iconv.h might be somewere else, etc. etc.).
> >
> >If you handle to build it with USE_ICONV=1 you'll have a -W <encoding>
> >flag. The value of <encoding> will be used for a 'SET CLIENT_ENCODING TO'
> >command in the head of output code, there are probably issues there as
> >well as postgresql will be more picky then iconv at recognizing (let
> >alone supporting) different encoding names.
> >
> >Consider it as an alpha feature, and only use for testing.
> >Tetsushi, please report any problem you might encounter with this.
> >
> >--strk;
> >
> 
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel

-- 

For standing up against patentability of software,

  Thank You, Poland!

Read the intervention:    http://kwiki.ffii.org/ConsPolon041221En
Send your thanks:         thankyoupoland.info
Read/do more:		  http://www.noepatents.org/



More information about the postgis-devel mailing list