Hi,
JSON RFC [1] says in Section 3 Encoding: "JSON text SHALL be encoded in
Unicode. The default encoding is UTF-8."
But geoserver's default encoding for json output is taken from global
encoding setting, which can be different to UTF-8 and therefor be not
unicode.
Today, many JSON parsers expect UTF-8 but get for example iso-8859-1 and
throw exceptions when handling special characters (german language).
But setting global encoding to UTF-8 could break compatibility to
existing WFS client apps and is therefor not so good.
Would you accept a patch, that uses hardcoded UTF-8 for JSON output no
matter what global encoding has been set?
What do you think?
[1] http://www.ietf.org/rfc/rfc4627.txt
Cheers Rudi
On Thu, Oct 18, 2012 at 3:56 PM, Hochmeister Rudolf <rudolf.hochmeister@anonymised.com> wrote:
Hi,
JSON RFC [1] says in Section 3 Encoding: “JSON text SHALL be encoded in
Unicode. The default encoding is UTF-8.”
But geoserver’s default encoding for json output is taken from global
encoding setting, which can be different to UTF-8 and therefor be not
unicode.
Today, many JSON parsers expect UTF-8 but get for example iso-8859-1 and
throw exceptions when handling special characters (german language).
But setting global encoding to UTF-8 could break compatibility to
existing WFS client apps and is therefor not so good.
Would you accept a patch, that uses hardcoded UTF-8 for JSON output no
matter what global encoding has been set?
What do you think?
[1] http://www.ietf.org/rfc/rfc4627.txt
Quoting:
- Encoding
JSON text SHALL be encoded in Unicode. The default encoding is
UTF-8.
So yeah, I don’t see any problem here
Cheers
Andrea
–
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