|
[
Permlink
| « Hide
]
Alexander Klimetschek added a comment - 10/May/07 09:16 AM
Affects cocoon-html-impl.
I forgot to mention that if someone wants to override this property via the configuration of the NekoHTMLTransformer, he can certainly do it. The manual config is applied after the dynamic setting of the encoding property, thus the manual one overrides the dynamic one.
This has bitten us too.
Here's a patch for Cocoon 2.1.X, rev 597695 Added Affects Version 2.1.11-dev
Anyone fancy applying the patches?
I fixed this issue in 2.2. The fix in 2.1 does not work since it uses java.nio which was only added in Java 1.4. Cocoon 2.1 has to be Java 1.3 compatible. Is there a way to find out the default encoding in Java 1.3? All the classes and methods were it would be necessary like new String(byte[]) or InputStreamReader() only point to http://java.sun.com/j2se/1.3/docs/api/java/lang/package-summary.html#charenc which just names some constants. With Mac OS X I also have no access to the source code of the JDK. The bytecode implies that the mentioned classes and methods use some Sun-internal class to retrieve the default encoding.
Also had to revert the fix for Cocoon 2.2 since Charset.defaultCharset() is only available on Java 5.
Oh, how annoying.
Is there a possibility of starting to use the src/jdk1.x directories for these kind of patches? Just because some people are stuck in the dark ages doesn't mean we can't shine a light... With Ant this would be rather easy as we already have some 1.4-specific code in Cocoon 2.1. No idea about Maven.
Is there really no other way to figure out the default encoding on before Java 5 JVMs? I'm not sure why generator needs to know encoding... Can it be simply always set to UTF-8?
As Vadim mentioned at http://marc.info/?l=xml-cocoon-dev&m=120905050708311&w=4 the NekoHTMLTransformer had an issue with converting String to byte[] using OS' default encoding rather than keeping the string - and so had the NekoHTMLGenerator when reading a request parameter value. These both issues are fixed in SVN and maybe caused the symptoms you saw. Closing the issue for now. Feel free to reopen it if problem still persists.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||