<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>> try to run the attached Java source.
</i></font>
<br><font size=2 face="Arial">...</font>
<br><font size=2 face="Courier New"><i>> "Südliche Weinstraße"
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. 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>> 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>> Try to convert the String before
you set the expression in your code</i></font><font size=2><tt><i>(->
String( byte </i></tt></font>
<br><font size=2><tt><i>> 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 "Mapserver-String" (?)</font>
<br><font size=2 face="sans-serif">-----------</font>
<br><font size=2 face="sans-serif">Is somebody willing to try to add an
"UTF-8 -> ISO-8859-Conversion" 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 <MAPSERVER-USERS@LISTS.UMN.EDU>
schrieb am 14.04.2006 15:23:51:<br>
<br>
> Olivier,<br>
> I GOT IT!<br>
> <br>
> try to run the attached Java source. If you pass it two arguments
the<br>
> first being the path to the map file and the second the string to<br>
> search for and you pass<br>
> "Südliche Weinstraße" as the second it will work!<br>
> <br>
> So why does it fail when "Südliche Weinstraße" is inside
the Java<br>
> code? That is a problem that only happens when javac compiles the<br>
> source: javac translates all characters to unicode and in doing that<br>
> it gets the german characters wrong.<br>
> To solve this give javac the following option: -source 1.4<br>
> <br>
> For more see this link:<br>
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5046139<br>
> <br>
> On 4/13/06, Umberto Nicoletti <umberto.nicoletti@gmail.com>
wrote:<br>
> > This is probably not related only to java mapscript, so please
read on.<br>
> ><br>
> <br>
> So I was wrong...but I'll leave the proof to the reader ;-)<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 <br>
> datasource.<br>
> > ><br>
> ><br>
> > Could someone of the other mapserver developers shed some light
on<br>
> this issue?<br>
> ><br>
> > I have a clue to give: php mapscript is using a different regex<br>
> > library and this explains why the match does not happen for Java<br>
> > mapscript, while it does happen in php mapscript. If I am right
also<br>
> > the mapserver cgi should be affected and possibly all other mapscript<br>
> > too.<br>
> ><br>
> > It would be very interesting if someone could report on similar<br>
> > experiences with the cgi-bin version of mapserver.<br>
> ><br>
> > Thanks,<br>
> > Umberto<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>
</tt></font>