Details
-
Bug
-
Resolution: Fixed
-
Major
-
2.0.1
-
None
-
patch
-
Trivial
-
Description
The character set defaults to ISO-8859-1 in javax.servlet.ServletResponse. It should be set to something.
The contents of the response to a "getPackageInfos" request are parsed from an xml-document ("package.xml" in the xar-file) and stored in a plain java string before inserted into the response. Since java strings are always unicode, I guess it is appropriate to hard-code UTF-8?
The below patch works for me, anyway.
Index: xwiki-core/src/main/java/com/xpn/xwiki/web/ImportAction.java =================================================================== --- xwiki-core/src/main/java/com/xpn/xwiki/web/ImportAction.java (revision 24289) +++ xwiki-core/src/main/java/com/xpn/xwiki/web/ImportAction.java (arbetskopia) @@ -37,7 +37,7 @@ // list files if ("getPackageInfos".equals(action)) { - response.setContentType("text/xml"); + response.setContentType("text/xml; charset=UTF-8"); XWikiAttachment packFile = doc.getAttachment(name); importer.Import(packFile.getContent(context)); String xml = importer.toXml();