[Geotiff] Unicode String in a GeoTiff file
Garner, Ken at KLEIN
Ken.Garner at L-3com.com
Mon May 14 17:09:05 EDT 2007
Hello All,
I am relatively new to creating Tiff or GeoTiff files. Thus, I
apologize in advance for any obvious errors contained herein.
I am creating a GeoTiff file for a customer who requires that Unicode
text strings be stored in the file. The text strings consist of
Japanese Kanji characters. Therefore, an ASCII string will not suffice.
My original plan was to generate a private GeoTiff key tag and store the
Unicode string as the value for that tag. As GTIFKeySet() only supports
types SHORT, DOUBLE, and ASCII, I planned to treat the Unicode string as
type SHORT with a length equivalent to the actual string length.
Looking at the source code for GTIFKeySet(), I find that parameter
"count" must equal 1 value for types SHORT and DOUBLE. I can not use
type ASCII and pass in a proper string length for the "count" parameter
because GTIFKeySet() ignores the "count" parameter and does a strlen()
instead. Since some Unicode characters have a leading 0 byte, that
method would not work for all possible characters in a Unicode string.
I have searched the mail archive and have not found a solution for this
problem.
Has anyone already solved this problem or have any suggestions for me?
Do I need to create a private TIFF tag instead and use TIFFSetField from
tifflib?
I am developing on windows and am using the libtiff.dll and geotiff.dll
from the Geotiff_win32_devkit.zip. My code inspection of GTIFKeySet()
was from the 1.3.2 GeoTiff zip file.
Best Regards,
Ken
Ken Garner
Principal Software Engineer
L-3 Communications Klein Associates, Inc.
Office (603) 893-6131 X-289
Web: www.L-3Klein.com
E-Mail: Ken.Garner at L-3com.com <mailto:Ken.Garner at L-3com.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/geotiff/attachments/20070514/01a8c5d3/attachment.html
More information about the Geotiff
mailing list