We're updating the issue view to help you get more done. 

reading characters of openfire.xml file fails if it is UTF-8 and not "locale" encoded

Description

XMLProperties.java uses a FileReader to read openfire.xml and this causes characters to be read in wrong.
Try to add <foo>å ä ö</foo> within openfire.xml and save it as UTF-8, add a breakpoint after buildDoc(reader); and verify then the read in data. It will be wrong encoded.
see also http://www.igniterealtime.org/forum/thread.jspa?messageID=151700&#151700 and http://www.stylusstudio.com/xmldev/199907/post30410.html

Environment

None

Acceptance Test - Entry

None

Activity

Show:
LG
November 18, 2007, 5:46 AM

Setting "-Dfile.encoding=UTF-8" solves also this issue (see JM-1190)

Daryl Herzmann
January 12, 2010, 12:47 AM

closing as there appears to be a logical workaround.

LG
March 3, 2010, 1:19 AM

Hi Daryl,

would you please re-open this issue. This is a workaround but this does not solve the problem. An XML file is UTF-8 encoded unless otherwise specified. And as far as I can tell the openfire.xml file starts with `<?xml version="1.0" encoding="UTF-8"?>´ so one must use UTF-8 encoding.

In XMLProperties.java I see
Reader reader = new BufferedReader(new InputStreamReader(in));
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(tempFile), "UTF-8"));

So I think it wouldn't hurt to add `, "UTF-8"´ to the reader.

LG

Daryl Herzmann
April 5, 2010, 4:25 PM

reopening and moving to OF

Fixed

Assignee

LG

Reporter

LG

Labels

None

Expected Effort

None

Ignite Forum URL

None

Components

Fix versions

Affects versions

Priority

Minor
Configure