[Geoserver-users] SLD encoding problem

Hi all!

I have SLD file in UTF-8. And i can’t load it with Style Editor.

When i’m trying to load file with “Upload…” Style Editor shows me error “java.io.IOException: Error parsing content”

And if i copy file content and just paste it into Style Editor field, error occurs later on layer preview: “Invalid byte 2 of 2-byte UTF-8 sequence.”

The thing is when i put my file directly in data_dir\styles, geoserver understand it perfectly well!

But i can’t grant access to this directory on remote server to all users. What’s wrong with Style Editor?

P.S. Geoserver 2.3.0, Windows 7 x32

At last i made geoserver understand right encoding with REST services.
The reason i need right encoding in style so badly is using GetLegendGraphic
request.
I have unicode symbols in legend labels, so wrong encoding breaks legend's
description.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-tp5046063p5063802.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Wed, Jul 3, 2013 at 2:09 PM, Kolosov Sergey <sergey.kolosof@anonymised.com>wrote:

At last i made geoserver understand right encoding with REST services.

So you made it work? How did you do it?

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

geowolf wrote

So you made it work? How did you do it?

I load all styles with cURL and geoserver REST. I have a PHP script on the
server which accepts sld (xml content) from the client and creates style in
geoserver. It's kind of workaround, but i see no other way for now.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-tp5046063p5063813.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

Is there a bug in geoserver about this ?
I also have a SLD file in UTF8. When i upload it, it is well uploaded and validated, the accent are ok :

sld:FeatureTypeNameXXXXXXXXX</sld:FeatureTypeName>
sld:Rule
sld:NameForêts et fourrés humides</sld:Name>
sld:TitleForêts et fourrés humides</sld:Title>
ogc:Filter

But when i click on “submit”, it saves my SLD, closes the ui and get back to styles list.

Then if i go back to my style, here is what is displayed :

sld:FeatureTypeStyle
sld:FeatureTypeNameXXXXXXXXX</sld:FeatureTypeName>
sld:Rule
sld:NameFor?ts et fourr?s humides</sld:Name>
sld:TitleFor?ts et fourr?s humides</sld:Title>

The encoding is not respected

···

On Wed, Jul 3, 2013 at 2:58 PM, Kolosov Sergey <sergey.kolosof@anonymised.com> wrote:

geowolf wrote

So you made it work? How did you do it?

I load all styles with cURL and geoserver REST. I have a PHP script on the
server which accepts sld (xml content) from the client and creates style in
geoserver. It’s kind of workaround, but i see no other way for now.


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-tp5046063p5063813.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Florent Gravin
Camptocamp - Chambéry
0479444492

Relativly to last mail :

My GS is 2.3.3 branch, i’m on debian

And if i go to my GS_DATA_DIR to open the uploaded SLD file, the encoding has been lost and the accent are bad like in GS ui.

···

On Tue, Jul 30, 2013 at 11:35 AM, Florent Gravin <florent.gravin@anonymised.com…> wrote:

Hi,

Is there a bug in geoserver about this ?
I also have a SLD file in UTF8. When i upload it, it is well uploaded and validated, the accent are ok :

sld:FeatureTypeNameXXXXXXXXX</sld:FeatureTypeName>
sld:Rule
sld:NameForêts et fourrés humides</sld:Name>
sld:TitleForêts et fourrés humides</sld:Title>
ogc:Filter

But when i click on “submit”, it saves my SLD, closes the ui and get back to styles list.

Then if i go back to my style, here is what is displayed :

sld:FeatureTypeStyle
sld:FeatureTypeNameXXXXXXXXX</sld:FeatureTypeName>
sld:Rule
sld:NameFor?ts et fourr?s humides</sld:Name>
sld:TitleFor?ts et fourr?s humides</sld:Title>

The encoding is not respected


Florent Gravin
Camptocamp - Chambéry
0479444492

On Wed, Jul 3, 2013 at 2:58 PM, Kolosov Sergey <sergey.kolosof@anonymised.com> wrote:

geowolf wrote

So you made it work? How did you do it?

I load all styles with cURL and geoserver REST. I have a PHP script on the
server which accepts sld (xml content) from the client and creates style in
geoserver. It’s kind of workaround, but i see no other way for now.


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-tp5046063p5063813.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Florent Gravin
Camptocamp - Chambéry
0479444492

Did you declare encoding in the <?xml ...?> header? if you did then you try using CDATA section to wrap the text. if not then use a &#nnn; to pass in encoding that is not declared ( the text within a CDATA section is strictly limited to the characters available in the encoding).

Vince

···

On Wed, Jul 3, 2013 at 2:58 PM, Kolosov Sergey <sergey.kolosof@…84…> wrote:

geowolf wrote

So you made it work? How did you do it?

I load all styles with cURL and geoserver REST. I have a PHP script on the
server which accepts sld (xml content) from the client and creates style in
geoserver. It’s kind of workaround, but i see no other way for now.


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-tp5046063p5063813.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Florent Gravin
Camptocamp - Chambéry
0479444492

Hi,

It was just because of the server encoding system…
The command #locale gives you the encoding system of the server …

You should have :

LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE=“en_US.UTF-8”
LC_NUMERIC=fr_CH.UTF-8
LC_TIME=“en_US.UTF-8”
LC_COLLATE=“en_US.UTF-8”
LC_MONETARY=“en_US.UTF-8”
LC_MESSAGES=“en_US.UTF-8”
LC_PAPER=“en_US.UTF-8”
LC_NAME=“en_US.UTF-8”
LC_ADDRESS=“en_US.UTF-8”
LC_TELEPHONE=“en_US.UTF-8”
LC_MEASUREMENT=“en_US.UTF-8”
LC_IDENTIFICATION=“en_US.UTF-8”
LC_ALL=

Once uploaded, the SLD were transform to fit the server locale, that’s why they were corrupt.

Thanks for help anyway.

···

On Tue, Jul 30, 2013 at 12:22 PM, Vince Lotito <vince@anonymised.com> wrote:

Did you declare encoding in the <?xml ...?> header? if you did then you try using CDATA section to wrap the text. if not then use a &#nnn; to pass in encoding that is not declared ( the text within a CDATA section is strictly limited to the characters available in the encoding).

Vince

Sent from my iPad

On Jul 30, 2013, at 6:00 AM, “Florent Gravin” <florent.gravin@anonymised.com> wrote:

Hi,

Is there a bug in geoserver about this ?
I also have a SLD file in UTF8. When i upload it, it is well uploaded and validated, the accent are ok :

sld:FeatureTypeNameXXXXXXXXX</sld:FeatureTypeName>
sld:Rule
sld:NameForêts et fourrés humides</sld:Name>
sld:TitleForêts et fourrés humides</sld:Title>
ogc:Filter

But when i click on “submit”, it saves my SLD, closes the ui and get back to styles list.

Then if i go back to my style, here is what is displayed :

sld:FeatureTypeStyle
sld:FeatureTypeNameXXXXXXXXX</sld:FeatureTypeName>
sld:Rule
sld:NameFor?ts et fourr?s humides</sld:Name>
sld:TitleFor?ts et fourr?s humides</sld:Title>

The encoding is not respected


Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Florent Gravin
Camptocamp - Chambéry
0479444492

On Wed, Jul 3, 2013 at 2:58 PM, Kolosov Sergey <sergey.kolosof@anonymised.com> wrote:

geowolf wrote

So you made it work? How did you do it?

I load all styles with cURL and geoserver REST. I have a PHP script on the
server which accepts sld (xml content) from the client and creates style in
geoserver. It’s kind of workaround, but i see no other way for now.


View this message in context: http://osgeo-org.1560.x6.nabble.com/SLD-encoding-problem-tp5046063p5063813.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users


Florent Gravin
Camptocamp - Chambéry
0479444492