Re: [OpenMap Users] DbfTableModel doesn't support double byte chars (e.g. Japanese chars)

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Tue, 18 Jan 2011 22:16:32 -0500

Hi Eros,

There are a couple of things you can do.

It looks like there is a readLEUTF method in the
LittleEndianInputStream, but it's not used anywhere. That method
looks like it only handles 16-bit Unicode strings though, and it's not
called anywhere in the OpenMap code. I seem to remember that
DbfTableModel was modified to handle Unicode some time ago, but I'm
not sure about that or when that would have changed back to being
unsupported.

Anyway, you can extend DbfTableModel to read those unicode characters,
which would really involve modifying the LittleEndianInputStream
readString() method and then having the DbfInputStream use that new
extended class to handle strings. I'm assuming that the strings you
are currently getting out of the DbfTableModel couldn't be modified
(taking each byte, combining them with their neighbors and forming
unicode from it) but I'd try that too. I'd be interested in seeing if
the current class is reading the strings with the correct number of
bytes for the unicode string and just interpreting it incorrectly by
not using the correct number of bytes per character.

The other thing you can do is use a different DBF file reader. If you
have the information out of the dbf file in the right order, you can
still use the EsriGraphicList to pull the geometries out of the shp
file, and the number and order should still match up.

Hope this helps,

Don

2011/1/18 GML$B%A%'%C%/%D!<%k(B <gml.check.tool_at_gmail.com>:
> Hi,
>
> I am trying to convert shp to gml file.
> I successfully extracted the EsriGraphic and the DbfTableModel..
> but the object (contents in japanese chars) upon getRecord are garbled..
>
> Please guide me on how can I support double byte.
>
> Thanks in advance.
>
> Eros
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe openmap-users"]
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Tue Jan 18 2011 - 22:17:34 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT