The CSS module for geoserver doesn't implement any escaping (it's on my todo
list, right up there with support for CQL filters that contain "]"...) I'll
make it conform to the usual CSS rules for escaping:
http://www.w3.org/TR/CSS2/syndata.html#escaped-characters
For Java String literals there is some escaping though: "\u2192" is the
escape sequence for the single arrow character you tried to reference in
your snippet above. Details are available at
http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.10.6
--
David Winslow
OpenGeo - http://opengeo.org/
On Wed, Aug 17, 2011 at 2:37 AM, Andrea Aime
<[email protected]>wrote:
> On Wed, Aug 17, 2011 at 6:21 AM, jerickson <[email protected]>
> wrote:
> > Hi all!
> >
> > I am trying to reduplicate the "Showing one Way" example found in
> Andrea's
> > wonderful "GeoServer Cartographic Rendering" presentation [1] from FOSS4G
> > 2010 in code using GeoTools StyleFactory (ultimately for GeoScript). When
> I
> > run this code snippet:
> >
> > TextSymbolizer text = styleFactory.createTextSymbolizer();
> > text.setFont(styleFactory.createFont(filterFactory.literal("Lucida
> Sans"),
> > filterFactory.literal("normal"), filterFactory.literal("bold"),
> > filterFactory.literal("10")));
> > text.setLabel(filterFactory.literal("&#x2192;"));
> >
> > I get an image with labels '&#x2192;' instead of arrows (see attached
> > image line_with_arrows.png). When I write this Style to SLD I see that
> the
> > '&' has been escaped:
> >
> > <sld:TextSymbolizer>
> > <sld:Label>
> > <ogc:Literal>&amp;#x2192;</ogc:Literal>
> > </sld:Label>
> > </sld:TextSymbolizer>
> >
> > When I change the SLD to <ogc:Literal>&#x2192;</ogc:Literal> and
> > regenerate my image I get the correct result (see attached image
> > line_with_arrow_from_sld.png). I am missing something or is this a bug?
> If
> > it's a bug I can file an issue with JIRA.
>
> You're mixing up xml encoding and in memory representation.
> In memory you don't have to escape stuff as if you intended to write it
> in XML, dealing with escaping is the duty of the xml parsers/encoders.
> For example, what if we were writing the style in David's CSS instead?
> The escaping rules might be different there
>
> Cheers
> Andrea
>
>
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054 Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax: +39 0584 962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users