OpenGeoportal / OGP

This is the active, community repository for the portal (including client JavaScript and server-side authentication and download Java code).
8 stars 15 forks source link

Fixes encoding problems with FGDC download #9

Closed gravesm closed 10 years ago

gravesm commented 10 years ago

By default the servlet response writer will use ISO 8859-1, so we should explicitly set it to UTF-8 in this case. Aside from potential encoding problems, the content-length header is being misreported in cases where the UTF-8 encoding differs in byte length than the ISO 8859-1 encoding.

In addition, the content-type should be set to application/xml not application/octet-stream.

For an example, look at the "Oceans (Geographic Feature Names, 2003)" layer. In particular, the section sign (U+00A7) is 2 bytes in UTF-8.