Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
5.3
-
None
Description
This is my first experience with JIRA, so apologies if it is not formatted properly. I raised this topic on the tapestry-users mailing list and was asked by a couple of people there to create an issue here.
internal.services.XMLTokenStream's openStream method contains the following lines:
InputStreamReader rawReader = new InputStreamReader(rawStream);
...
PrintWriter writer = new PrintWriter(bos);
Both of these implicitly rely on the default JVM charset. This poses a significant problem for non-ASCII text in templates on Google App Engine, where the default is "US-ASCII". In the interests of robustness, I think it would be nice if Tapestry was able to eliminate any reliance on default charsets. I am not confident enough in my understanding of Tapestry internals to know how to appropriately retrieve symbol properties (such as "tapestry.charset") via the IoC system in internal service implementations, but I have verified that explicitly specifying "UTF-8" as follows resolved my problem:
InputStreamReader rawReader = new InputStreamReader(rawStream, "UTF-8");
...
PrintWriter writer = new PrintWriter( new OutputStreamWriter(bos, "UTF-8") );
Attachments
Attachments
Issue Links
- duplicates
-
TAP5-2219 XML-Parsing broken if system encoding is not UTF-8
- Closed
- is duplicated by
-
TAP5-2219 XML-Parsing broken if system encoding is not UTF-8
- Closed
- relates to
-
TAP5-1741 Parsing template which contains Chinese (Maybe other double bytes) words throws MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.
- Closed