<br><font size=2 face="sans-serif">Umberto, Nic</font><font size=2 face="Arial">ol,
Norbert, Oliver</font>
<br>
<br><font size=2 face="Arial">Umberto wrote</font>
<br><font size=2 face="Arial"><i>&gt; try to run the attached Java source.
</i></font>
<br><font size=2 face="Arial">...</font>
<br><font size=2 face="Courier New"><i>&gt; &quot;Südliche Weinstraße&quot;
as the second it will work!</i></font><font size=2 face="Arial"><br>
</font>
<br><font size=2 face="Arial">In my copy of your mail the queryByAttribute.java-program
is not </font>
<br><font size=2 face="Arial">attached. &nbsp;Could somebody post program
including testdata (or download-url) ?</font>
<br>
<br><font size=2 face="Arial">I 'd like to study a running example, because
I don't understand </font>
<br><font size=2 face="Arial">how umlaut-conversion from Java to Mapserver-kernel
can run </font>
<br><font size=2 face="Arial">properly anyway and I'd like to understand
it :-)</font>
<br><font size=2 face="sans-serif">-----------</font>
<br><font size=2 face="Arial">It seems Norbert found a kind of answer to
his question </font>
<br><font size=2 face="Arial"><i>&gt; is there a way to do the converion
in java dircetly?</i></font>
<br><font size=2 face="Arial">He suggested</font>
<br><font size=2 face="Arial"><i>&gt; Try to convert the String before
you set the expression in your code</i></font><font size=2><tt><i>(-&gt;
String( byte </i></tt></font>
<br><font size=2><tt><i>&gt; bytes[], String ) </i></tt></font>
<br><font size=2 face="Arial">Could you be more precisly? I do not understand
what must be converted to what.</font>
<br><font size=2 face="Arial">How must this be applied </font><font size=2 face="sans-serif">to
convert a Java-String to a proper &quot;Mapserver-String&quot; (?)</font>
<br><font size=2 face="sans-serif">-----------</font>
<br><font size=2 face="sans-serif">Is somebody willing to try to add an
&quot;UTF-8 -&gt; ISO-8859-Conversion&quot; in</font>
<br><font size=2 face="sans-serif">mapscript_wrap.c for testpurposes? (Even
in the case it works, this would </font>
<br><font size=2 face="sans-serif">not be a real solution because it bypasses
swig.)</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 14.04.2006 15:23:51:<br>
<br>
&gt; Olivier,<br>
&gt; I GOT IT!<br>
&gt; <br>
&gt; try to run the attached Java source. If you pass it two arguments
the<br>
&gt; first being the path to the map file and the second the string to<br>
&gt; search for and you pass<br>
&gt; &quot;Südliche Weinstraße&quot; as the second it will work!<br>
&gt; <br>
&gt; So why does it fail when &quot;Südliche Weinstraße&quot; is inside
the Java<br>
&gt; code? That is a problem that only happens when javac compiles the<br>
&gt; source: javac translates all characters to unicode and in doing that<br>
&gt; it gets the german characters wrong.<br>
&gt; To solve this give javac the following option: -source 1.4<br>
&gt; <br>
&gt; For more see this link:<br>
&gt; http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5046139<br>
&gt; <br>
&gt; On 4/13/06, Umberto Nicoletti &lt;umberto.nicoletti@gmail.com&gt;
wrote:<br>
&gt; &gt; This is probably not related only to java mapscript, so please
read on.<br>
&gt; &gt;<br>
&gt; <br>
&gt; So I was wrong...but I'll leave the proof to the reader ;-)<br>
&gt; <br>
&gt; Best regards,<br>
&gt; Umberto<br>
&gt; <br>
&gt; &gt; On 3/30/06, Oliver Wesp &lt;wesp@gdv.com&gt; wrote:<br>
&gt; &gt; &gt; Dear List,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I' struggling with queryByAttributes on an attribute field
with german<br>
&gt; &gt; &gt; umlauts using java mapscript.<br>
&gt; &gt; &gt; The odd thing is that the same thing works fine with php
mapscript and<br>
&gt; &gt; &gt; when I use expressions in my &nbsp;mapfile. I'm using a
shapefile as <br>
&gt; datasource.<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Could someone of the other mapserver developers shed some light
on<br>
&gt; this issue?<br>
&gt; &gt;<br>
&gt; &gt; I have a clue to give: php mapscript is using a different regex<br>
&gt; &gt; library and this explains why the match does not happen for Java<br>
&gt; &gt; mapscript, while it does happen in php mapscript. If I am right
also<br>
&gt; &gt; the mapserver cgi should be affected and possibly all other mapscript<br>
&gt; &gt; too.<br>
&gt; &gt;<br>
&gt; &gt; It would be very interesting if someone could report on similar<br>
&gt; &gt; experiences with the cgi-bin version of mapserver.<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt; Umberto<br>
&gt; &gt;<br>
&gt; &gt; &gt; Here is what I do:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; layer.queryByAttributes(map,&quot;KREIS_NAME&quot;, &quot;/Südliche
Weinstraße/&quot;,<br>
&gt; &gt; &gt; mapscriptConstants.MS_MULTIPLE);<br>
&gt; &gt; &gt; layer.open();<br>
&gt; &gt; &gt; System.out.println( &quot;Result Count: &quot; +layer.getNumResults()
);<br>
&gt; &gt; &gt; layer.close();<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; The result is always null while replacing the qstring with
something<br>
&gt; &gt; &gt; that doesn't contain special characters (e.g.<br>
&gt; &gt; &gt; 'Mainz-Bingen') works fine.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; As noted above the following layer definition in a mapfile
works fine<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; LAYER<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;NAME kreis<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;STATUS DEFAULT<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;TYPE polygon<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;DATA &quot;/tmp/subset&quot;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;TEMPLATE &quot;kreis.html&quot;<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;CLASSITEM KREIS_NAME<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;CLASS<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;NAME Boundary<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;COLOR 128 128 0<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;OUTLINECOLOR 0 0 0<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp; &nbsp;EXPRESSION /Südliche Weinstraße/<br>
&gt; &gt; &gt; &nbsp; &nbsp; &nbsp;END<br>
&gt; &gt; &gt; END<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; but this does not:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; layer.setClassitem(&quot;KREIS_NAME&quot;);<br>
&gt; &gt; &gt; classObj cl = new classObj(layer);<br>
&gt; &gt; &gt; cl.setName(&quot;Classname&quot;);<br>
&gt; &gt; &gt; cl.setExpression(&quot;/Südliche Weinstraße/&quot;);<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I use Mapserver 4.8.1 on W2k, Tomcat 5.0.28.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I can provide some sample data, just in case someone likes
to reproduce.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Any help is appreciated.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; best regards<br>
&gt; &gt; &gt; Oliver<br>
&gt; &gt; &gt; --<br>
&gt; &gt; &gt; Dipl.-Geogr. Oliver Wesp<br>
&gt; &gt; &gt; Gesellschaft fuer geografische Datenverarbeitung<br>
&gt; &gt; &gt; Binger Strasse 49-51<br>
&gt; &gt; &gt; D-55218 Ingelheim<br>
&gt; &gt; &gt; fon: +49 6132 714818<br>
&gt; &gt; &gt; fax: +49 6132 714828<br>
&gt; &gt; &gt; http: www.gdv.com<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
</tt></font>