<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Mikael,</p>
<p>to my surprise, the HFA format is actually published at
<a class="moz-txt-link-freetext" href="https://hexagongeospatial.fluidtopics.net/r/fH0o7KrMKUViXGUeoilQuA/5DlRUpslzb6NK6uTz98KSg">https://hexagongeospatial.fluidtopics.net/r/fH0o7KrMKUViXGUeoilQuA/5DlRUpslzb6NK6uTz98KSg</a>
. Not sure if it is "new" or had already been available. From a
quick look, it doesn't mention anything about string encoding.</p>
<p>My intuition would be that the encoding would be whatever the one
of the machine generated the file was, but perhaps that's a fixed
one. You could potentially try to ask Hexagon support about that.</p>
<p>GDAL itself makes not that many assumptions about the encoding,
although it tries to expose as UTF-8 as much as possible (and
recode to UTF-8 when it knows the source encoding), otherwise it
will present strings as they are, hoping for the best. But
language bindings might make stronger assumptions and indeed
misbehave when UTF-8 is not encountered</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 26/06/2023 à 11:43, Mikael Rittri a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:HE1PR03MB30847A1B4CDE96919FFAC9409F26A@HE1PR03MB3084.eurprd03.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}@font-face
{font-family:"Segoe UI Semibold";
panose-1:2 11 7 2 4 2 4 2 2 3;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;
mso-fareast-language:EN-US;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Segoe UI",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}div.WordSection1
{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="EN-GB">Hello list.
<br>
<br>
I have encountered a Filename.tif with an associated
metadata file, Filename.aux. The .aux file can be understood
by gdalinfo, which says<br>
<br>
</span><span style="font-family:"Courier New""
lang="EN-GB">Driver: HFA/Erdas Imagine Images (.img)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New"" lang="EN-GB">Files: Filename.aux<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New"" lang="EN-GB"> Filename.rrd<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Courier
New"" lang="EN-GB"> Filename.rde
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="en-SE"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="EN-GB">As I understand it, the
.aux file is on an Erdas Imagine format intended to describe
metadata for the Erdas .img format, but it can also be used
to describe metadata for .tif files as in my case. (I have
the Filename.rrd and the Filename.rde but not any
Filename.img, so it is somewhat strange but useful that GDAL
can read the .aux file directly).
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="EN-GB">Anyway, my question is:
when the Filename.aux contains strings, in my case
descriptions of terrain types represented by integers (part
of a Raster Attribute Table), is there an established way to
figure out whether the strings are stored in UTF-8, or if
not, what codepage is used? In my case, the strings seem to
be stored as 8-bit ASCII using the codepage 1252 (mainly for
West-European alphabets), but GDAL seems to expect UTF-8 so
the Swedish characters with diacritics become garbled. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="EN-GB">I realize that if the .aux
format is proprietary and has just been reverse-engineered,
then maybe no-one knows the answer to this. But I am curious
if anyone has had similar problems and maybe figured out a
workaround. Or if there are any grounds to say that UTF-8 is
mandatory in the .aux format, then my example file would be
incorrect and that would also be useful to know.
<br>
<br>
Best regards, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Segoe
UI",sans-serif" lang="en-SE"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Segoe UI
Semibold",sans-serif;color:#D18765;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-US">Mikael Rittri</span><span
style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#D18765;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:8.0pt;font-family:"Segoe UI
Semibold",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-US">Carmenta Geospatial Technologies<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:8.0pt;font-family:"Segoe UI
Semibold",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-US">Sweden</span><span
style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:8.0pt;font-family:"Segoe
UI",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-GB">carmenta.com<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:9.0pt;font-family:"Segoe
UI",sans-serif;color:black;mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="mso-ligatures:none;mso-fareast-language:#2000"
lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="en-SE"><o:p> </o:p></span></p>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>