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