Mikhial Usatchev wrote: > Hello, > > I tried doing my best to understand a problem in the Cocoon framework > connected with non-English encoding, but all's in vain. (Cocoon 2.1.7 > built under Windows 2000) > Whatever I wrote in the head of my origin XML document > <?xml version="1.0" encoding="windows-1251"?> or > <?xml version="1.0"?> or so, it always generated an output document in > either UTF-8 or ISO-8859-1 encoding. Alas, that makes Cocoon impossible > for me to use. I didn't manage to find any answers in the documentation > nor on the Internet. > Can you please tell me how I can have all my documents generated in > "windows-1251" encoding? >
[explanation] the resulting output-encoding is set by the serializer (i.e. the last one in the pipeline, inside the pipeline everything is passed as java strings, only when those are read from byte-stream-sources or externalized to byte-stream-output an encoding should be specified.) the encoding you played with in the XML document is at the input-level: only a hint for the generator/parser so it will decode the source-bytes correctly into the java-strings that are fed into the pipelines [answer] read up http://cocoon.apache.org/2.1/userdocs/serializers/html-serializer.html also: there was a patch long ago to make serializers by default take up the 'form-encoding' servlet-parameter (see the web.xml) as the one to use if no <encoding> is specified on the serializer itself the reasoning behind that was that this automatically makes the request-param decoding in sync with the html encoding (meaning: makes form-data filled in by end-users work ok) [extra] be aware though of the golden rule of encoding: RULE 0: you should always use UTF-8, with the only possible exception that you might want to prefer UTF-8 ;-) (meaning I'm curious on why UTF-8 is no good, are you using specific user-agents that require it? or are you generating forms that have actions to other sites that require specific encoding ? Note: depending on what you need to do your optimal configuration might look slightly different) > Tanks in advance. > Mikhail Usatchev have fun, -marc= -- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
