Encoding in features attributes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Encoding in features attributes

juanma.mr
Dear list,

I have a WFS layer already loaded in Openlayers 2.13 version. The problem is that some attributes are spanish characters and are not shown correctly.

I have checked and in database and WFS response are correctly shown in pgadmin and firebug. When checking feature attributes already loaded in OpenLayers with firebug it shows them with strange characters. The webpage OL is loaded is in UTF8 encoding.

I have looked in OL documentation for some kind of encoding parameter for WFS layer / protocol. Is OL using any internal encoding or maybe firebug assumes something in WFS communication that OL do not?

Regards,
Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: +34 967599200 (Ext: 2627)

http://www.teledeteccionysig.es/

_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Reply | Threaded
Open this post in threaded view
|

RE Encoding in features attributes

Steve.Toutant
What do you mean by "WFS response are correctly shown in pgadmin"

Is your postgis database use encoding utf-8?

What is your wfs server and version?


"Juanma M. R." <[hidden email]>@lists.osgeo.org
Envoyé par : "Users" <[hidden email]>

2015-10-09 05:57

A
[hidden email]
cc
Objet
[OpenLayers-Users] Encoding in features attributes







Dear list,

I have a WFS layer already loaded in Openlayers 2.13 version. The problem is that some attributes are spanish characters and are not shown correctly.

I have checked and in database and WFS response are correctly shown in pgadmin and firebug. When checking feature attributes already loaded in OpenLayers with firebug it shows them with strange characters. The webpage OL is loaded is in UTF8 encoding.

I have looked in OL documentation for some kind of encoding parameter for WFS layer / protocol. Is OL using any internal encoding or maybe firebug assumes something in WFS communication that OL do not?

Regards,
Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: +34 967599200 (Ext: 2627)

http://www.teledeteccionysig.es/_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users



_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply | Threaded
Open this post in threaded view
|

Re: RE Encoding in features attributes

juanma.mr
Hi,

Sorry, I mixed a little bit both things in the same phrase. I can see correctly stored data in postgis (it has UTF8 encoding in the database) with PGAdmin. I can see also correctly in firebug the WFS communication.

The WFS server is version 1.1.0 based on Mapserver 6.4.

Finally I got the string correctly shown from OL feature by decoding it from UTF8. I needed to include a js library with the functionallity to decode/encode UTF8. It seems firebug show OL vars without applying any decoding but OL stored them correctly.

This makes me thinking of how OL stored strings. I assume it stores whatever it receives and is the aplication using it in charge of encoding/decoding, isn't it? Or maybe it has a encoding parameter or functions to be used when retrieving strings from OL objects?

Thank you for being patient with my previous badly writen email. After rereading it I realized it was not clear enought.

Regards,

Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: +34 967599200 (Ext: 2627)

http://www.teledeteccionysig.es/

2015-10-09 16:21 GMT+02:00 <[hidden email]>:
What do you mean by "WFS response are correctly shown in pgadmin"

Is your postgis database use encoding utf-8?

What is your wfs server and version?


"Juanma M. R." <[hidden email]>@lists.osgeo.org
Envoyé par : "Users" <[hidden email]>

2015-10-09 05:57

A
[hidden email]
cc
Objet
[OpenLayers-Users] Encoding in features attributes







Dear list,

I have a WFS layer already loaded in Openlayers 2.13 version. The problem is that some attributes are spanish characters and are not shown correctly.

I have checked and in database and WFS response are correctly shown in pgadmin and firebug. When checking feature attributes already loaded in OpenLayers with firebug it shows them with strange characters. The webpage OL is loaded is in UTF8 encoding.

I have looked in OL documentation for some kind of encoding parameter for WFS layer / protocol. Is OL using any internal encoding or maybe firebug assumes something in WFS communication that OL do not?

Regards,
Juan Manuel Moreno Rivera.

Sección de Teledetección y SIG / Remote Sensing & GIS group

Instituto de Desarrollo Regional / Institute for Regional Development

Universidad de Castilla-La Mancha / University of Castilla-La Mancha

Tlf: <a href="tel:%2B34%20967599200" value="+34967599200" target="_blank">+34 967599200 (Ext: 2627)

http://www.teledeteccionysig.es/_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users




_______________________________________________
Users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-users