<br><font size=2 face="sans-serif">Hi</font>
<br>
<br><font size=2 face="sans-serif">The C-Wrapper &quot;mapscript_wrap.c&quot;
converts Java-Strings to</font>
<br><font size=2 face="sans-serif">&quot;char*&quot; with the JNI-Function
&quot;GetStringUTFChars&quot;.</font>
<br><font size=2 face="sans-serif">This UTF-8-byte-sequence is passed to
the mapserver-kernel.</font>
<br><font size=2 face="sans-serif">But mapserver-kernel expects an one-byte-encoding.
(ISO-8859-1 or CP437 (!?))</font>
<br>
<br><font size=2 face="sans-serif">I wrote a JNI-sample-program to illustrate.
&nbsp;</font>
<br><font size=2 face="sans-serif">The sample-program converts to UTF-8,
ISO-8859-1 and CP437.</font>
<br><font size=2 face="sans-serif">On my Windows-Command-Prompt the CP437-result
was correct.</font>
<br>
<br><font size=2 face="sans-serif">I think mapscript_wrap.c has to do more
than &nbsp;UTF-8-Conversion.</font>
<br>
<br><font size=2 face="sans-serif">Benedikt</font>
<br>
<br>
<br><font size=2><tt>UMN MapServer Users List &lt;MAPSERVER-USERS@LISTS.UMN.EDU&gt;
schrieb am 12.04.2006 16:27:40:<br>
<br>
&gt; I have been able to reproduce the issue, but in the meanwhile Java<br>
&gt; mapscript began crashing on msDrawMap so I am now working on that
too.<br>
&gt; <br>
&gt; Regards,<br>
&gt; Umberto<br>
&gt; <br>
&gt; On 4/10/06, Umberto Nicoletti &lt;umberto.nicoletti@gmail.com&gt;
wrote:<br>
&gt; &gt; So it seems that the special character gets passed correctly
back and<br>
&gt; &gt; forth between the Java and c code.<br>
&gt; &gt;<br>
&gt; &gt; I'll investigate.<br>
&gt; &gt; Umberto<br>
&gt; &gt;<br>
&gt; &gt; On 4/10/06, Nicol Hermann &lt;nicol@nicol.info&gt; wrote:<br>
&gt; &gt; &gt; Hi Umberto,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; i include the class in my development environment and run
it.<br>
&gt; &gt; &gt; Here are the generated output:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Setting expression to: /StraÃe/<br>
&gt; &gt; &gt; Retrieving expression: /StraÃe/<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Nicol<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Am Montag, den 10.04.2006, 09:57 +0200 schrieb Umberto Nicoletti:<br>
&gt; &gt; &gt; &gt; Thanks,<br>
&gt; &gt; &gt; &gt; I'll look into this asap.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Please try to compile this small Java class and run
it (simply put it<br>
&gt; &gt; &gt; &gt; in mapscript/java/examples) and run like the DrawMap.java
example. I<br>
&gt; &gt; &gt; &gt; use it only to prove that unicode strings are treated
correctly by the<br>
&gt; &gt; &gt; &gt; JNI layer between Java and the native c code.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Regards,<br>
&gt; &gt; &gt; &gt; Umberto<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; On 4/10/06, Nicol Hermann &lt;nicol@nicol.info&gt;
wrote:<br>
&gt; &gt; &gt; &gt; &gt; Umberto,<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; as announced in my previous mail some sample data
to the querybyattribut<br>
&gt; &gt; &gt; &gt; &gt; issue with Java Mapscript.<br>
&gt; &gt; &gt; &gt; &gt; Please excuse me that i send you this mail directly.
It bounces due to<br>
&gt; &gt; &gt; &gt; &gt; size limitation of the mailing list.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; I attached one ZIP file with a Shape File. This
file contains 2<br>
&gt; &gt; &gt; &gt; &gt; features. One with 'KREIS_NAME' = 'Südliche Weinstraße'
and one with<br>
&gt; &gt; &gt; &gt; &gt; 'KREIS_NAME' = 'Mainz-Bingen'.<br>
&gt; &gt; &gt; &gt; &gt; QueryByAttribut (layer.queryByAttributes(map,&quot;KREIS_NAME&quot;,
&quot;/Südliche<br>
&gt; &gt; &gt; &gt; &gt; Weinstraße/&quot;, mapscriptConstants.MS_MULTIPLE);)
with 'Mainz-Bingen'<br>
&gt; &gt; &gt; &gt; &gt; works fine the other one with the german umlauts
(Südliche Weinstraße)<br>
&gt; &gt; &gt; &gt; &gt; do not.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; As Oliver noted in his first mail the same query
also works with php<br>
&gt; &gt; &gt; &gt; &gt; mapscript and when we use this thing within an
expression of a mapFile.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; I also attached one mapFile and one java class
which uses the subset.shp<br>
&gt; &gt; &gt; &gt; &gt; and could be used to simulate the problem.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Oliver uses a windows environment (win 2000 and
ms 4.8.1). I use a linux<br>
&gt; &gt; &gt; &gt; &gt; box (debian sarge and also ms 4.8.1). My language
environment is:<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; nicol@emil:~$ echo $LANG<br>
&gt; &gt; &gt; &gt; &gt; de_DE@euro<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; The behaviour is the same on both OS.<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Please let me know if you need further informations.<br>
&gt; &gt; &gt; &gt; &gt; Thanks you very much for working on this issue<br>
&gt; &gt; &gt; &gt; &gt; Nicol<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; Am Freitag, den 07.04.2006, 15:08 +0200 schrieb
Umberto Nicoletti:<br>
&gt; &gt; &gt; &gt; &gt; &gt; Oliver,<br>
&gt; &gt; &gt; &gt; &gt; &gt; did you solve this issue?<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; If not please send some sample data that
I can use to work on it.<br>
&gt; &gt; &gt; &gt; &gt; &gt; Also I need know on which OS you are and
the language environment you use:<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; echo $LANG (on unix/linux)<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; Best regards,<br>
&gt; &gt; &gt; &gt; &gt; &gt; Umberto<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; On 3/30/06, Oliver Wesp &lt;wesp@gdv.com&gt;
wrote:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Dear List,<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; I' struggling with queryByAttributes
on an attribute field with german<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; umlauts using java mapscript.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; The odd thing is that the same thing
works fine with php mapscript and<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; when I use expressions in my &nbsp;mapfile.
I'm using a shapefile as datasource.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Here is what I do:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; layer.queryByAttributes(map,&quot;KREIS_NAME&quot;,
&quot;/Südliche Weinstraße/&quot;,<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; mapscriptConstants.MS_MULTIPLE);<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; layer.open();<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; System.out.println( &quot;Result Count:
&quot; +layer.getNumResults() );<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; layer.close();<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; The result is always null while replacing
the qstring with something<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; that doesn't contain special characters
(e.g.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 'Mainz-Bingen') works fine.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; As noted above the following layer definition
in a mapfile works fine<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; LAYER<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;NAME kreis<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;STATUS DEFAULT<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;TYPE polygon<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;DATA &quot;/tmp/subset&quot;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;TEMPLATE &quot;kreis.html&quot;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;CLASSITEM KREIS_NAME<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;CLASS<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;NAME Boundary<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;COLOR 128
128 0<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;OUTLINECOLOR
0 0 0<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;EXPRESSION
/Südliche Weinstraße/<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; &nbsp; &nbsp; &nbsp;END<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; END<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; but this does not:<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; layer.setClassitem(&quot;KREIS_NAME&quot;);<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; classObj cl = new classObj(layer);<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; cl.setName(&quot;Classname&quot;);<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; cl.setExpression(&quot;/Südliche Weinstraße/&quot;);<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; I use Mapserver 4.8.1 on W2k, Tomcat
5.0.28.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; I can provide some sample data, just
in case someone likes to reproduce.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Any help is appreciated.<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; best regards<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Oliver<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; --<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Dipl.-Geogr. Oliver Wesp<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Gesellschaft fuer geografische Datenverarbeitung<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Binger Strasse 49-51<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; D-55218 Ingelheim<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; fon: +49 6132 714818<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; fax: +49 6132 714828<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt; http: www.gdv.com<br>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
</tt></font>