Hello again,
Thanks for answering. You seem to be the only one here lately...

On Sun, May 3, 2009 at 8:09 PM, Jocelyn Jaubert
<jocelyn.jaub...@gmail.com>wrote:

> Hi,
>
> Le 3 mai 2009, Tal a écrit :
> > I hope the following is a reasonable solution for bug 2163652 (GPX
> > file with byte order mark not parsed).
> > It simply treats files with ".gpx" extention as gpx files. All other
> > files, including gpx files without gpx extentions, receive the same
> > treatment as before.
>
> I think I already tried something like your path, but I'm afraid that
> it is more complex than this.
>
> If the file is encoded as UTF-16, then we must open and read the file
> in UTF-16 (2 bytes per character), not in any other encoding which
> uses any other character size. That's where I am stuck - I don't know
> if there is any easy way to propagate the file encoding with the file
> pointer. Maybe the best way would be to read the whole file at one
> place, and use this string everywhere ?
>

Just to be 100% sure, I checked my patch with utf-16 encoded gpx file, and
it works very well.
Where do you see a problem? is it:
1) when we check the "magic number" of the file, we should differentiate
between utf-8, utf-16 encodins?
2) when we actually parse the gpx file?
3) something else?

Number 1 is indeed a problem, but it is solved by removing the magic number
check for *.gpx files.

Number 2 is not a problem. The file is parsed in gpx.c using the xml library
expat, which is responsible for most of the xml related headaches, including
proper character encoding and decoding for utf-8, utf-16, etc.
gpx.c reads bytes, feeds them to expat, and gets back parsed and re-encoded
utf-8 strings.

But maybe you meant something else?

Hopefully not...

Tal
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/

Reply via email to