hhuijser/liferay-portal — pull request #1057 by daledotshan (2012-11-20 03:25:41+00:00)
Title: LPS-31080

This issue caused by tomcat 6 does not override the println method of ServletOutputStream class,
Here is the the code snippet of println method of ServletOutputStream class

public void print(String s) throws IOException {
if (s==null) s="null";
int len = s.length();
for (int i = 0; i < len; i++) {
char c = s.charAt ;

//
// XXX NOTE: This is clearly incorrect for many strings,
// but is the only consistent approach within the current
// servlet framework. It must suffice until servlet output
// streams properly encode their output.
//
if ((c & 0xff00) != 0) {	// high order byte must be zero String errMsg = lStrings.getString("err.not_iso8859_1"); Object[] errArgs = new Object[1]; errArgs[0] = new Character(c); errMsg = MessageFormat.format(errMsg, errArgs); throw new CharConversionException(errMsg); }
write (c);
}
}

The code c & 0xff00) != 0 restrict char c must be a ASCII otherwise will throw CharConversionException, so if char c is chinese character it will throwCharConversionException

Use writer method of PrintWriter class to avoid this issue.