Re: Umlauts in cocoon 2.0.2
Thanks to everyone who replied to this thread, I managed to crack it in the end. The solution to my umlaut problem consisted of: 1. Putting this action at the top of the pipeline which handles the UTF-8 post: map:act type=set-encoding map:parameter name=form-encoding value=UTF-8/ /map:act 2. Saving all my files ensuring the bytes written to disk were UTF-8 (as Ugo, Antonio and Joerg told me). Specifically, my sitemap, web.xml, all xsl files, and any static xml files I read in my pipelines. 3. Putting an encoding child in my serializers, e.g. map:serializer name=xhtml ... encodingUTF-8/encoding !-- KR added -- /map:serializer Step 3 may be optional, but I know the container-encoding of cocoon defaults to ISO-8859-1 so I thought it best left in. I am sure that step 1 can be replaced by setting the form-encoding parameter in the cocoon init-params, but doing this has knock on effects I hinted at in an earlier post, as I think there is a bug in the cocoon code (2.0.2, anyway). Fortunately, for the moment I can avoid this. Thanks for everyone's help! Kenneth On Wed, 2002-09-18 at 15:41, Kenneth Roper wrote: Firstly, thanks for everyone's suggestions, this is a very helpful list! Unfortunately, I am no further forward. Changing the encoding of the sitemap.xmap and the web.xml file has no effect. Changing the encoding of the xhtml serializer looked like I was on the right track, but unfortunately doesn't work: I have a this string in my db: ÄäÖöÜüß It is displayed on an html page generated by a cocoon pipeline. If I change my serializer definition in my sitemap and add this: encodingISO-8859-1/encoding The above string appears in my browser (and in the page source) as 7 question marks, i.e. ??? If I change the encoding back to this: encodingUTF-8/encoding I can then see my original string correctly. However, if I post this string back to my application, my application receives the string as first detailed in the original post (i.e. ÃäÃöÃüÃ). There is obviously a difference in encoding (or something) between text coming from the server to the browser, and the text posted from the browser back to the server. Any more ideas? Thanks again. Kenneth - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Umlauts in cocoon 2.0.2
Firstly, thanks for everyone's suggestions, this is a very helpful list! Unfortunately, I am no further forward. Changing the encoding of the sitemap.xmap and the web.xml file has no effect. Changing the encoding of the xhtml serializer looked like I was on the right track, but unfortunately doesn't work: I have a this string in my db: ÄäÖöÜüß It is displayed on an html page generated by a cocoon pipeline. If I change my serializer definition in my sitemap and add this: encodingISO-8859-1/encoding The above string appears in my browser (and in the page source) as 7 question marks, i.e. ??? If I change the encoding back to this: encodingUTF-8/encoding I can then see my original string correctly. However, if I post this string back to my application, my application receives the string as first detailed in the original post (i.e. ÃäÃöÃüÃ). There is obviously a difference in encoding (or something) between text coming from the server to the browser, and the text posted from the browser back to the server. Any more ideas? Thanks again. Kenneth - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Umlauts in cocoon 2.0.2
I GUARANTEE it is not the DB. If it was the DB it wouldn't display correctly the first time. Also, I have determined that the string is mangled when it is retrieved from the HTTPRequest, long before it is inserted into the DB. Manually inserting the string into the DB over the same DB drivers works fine. This is purely a servlet / cocoon issue. On Wed, 2002-09-18 at 15:50, Antonio Gallardo Rivera wrote: Please tell us what database are you using? And what encoding the database is? This looks like a conflict between the database encoding and the application. Antonio Gallardo. El Miércoles, 18 de Septiembre de 2002 08:41, Kenneth Roper escribió: Firstly, thanks for everyone's suggestions, this is a very helpful list! Unfortunately, I am no further forward. Changing the encoding of the sitemap.xmap and the web.xml file has no effect. Changing the encoding of the xhtml serializer looked like I was on the right track, but unfortunately doesn't work: I have a this string in my db: ÄäÖöÜüß It is displayed on an html page generated by a cocoon pipeline. If I change my serializer definition in my sitemap and add this: encodingISO-8859-1/encoding The above string appears in my browser (and in the page source) as 7 question marks, i.e. ??? If I change the encoding back to this: encodingUTF-8/encoding I can then see my original string correctly. However, if I post this string back to my application, my application receives the string as first detailed in the original post (i.e. ÃäÃöÃüÃ). There is obviously a difference in encoding (or something) between text coming from the server to the browser, and the text posted from the browser back to the server. Any more ideas? Thanks again. Kenneth - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Umlauts in cocoon 2.0.2
Antonio Sorry if I came across a bit harsh, I just meant to emphasise the point. A db conflict was my first instinct, too, so I spent a fair bit of time investigating that and have ruled it out. I guess after spending a day and a half messing around with text-encoding my nerves are shot! Anyway, I haven't investigated the format the files are stored in, yet. Which files in particular do you suspect? All my xml is generated dynamically, it's just the xsls which are persisted in files. Surely only the last transformer which is run should determine the character encoding posted by the browser? I've been reading the cocoon code, and have been experimenting with setting the form-encoding and container-encoding startup attributes, but I'm having to struggle through null pointer exceptions being thrown in the cocoon decode() method. Original exception : java.lang.NullPointerException at org.apache.cocoon.environment.http.HttpRequest.decode(HttpRequest.java:300) at org.apache.cocoon.environment.http.HttpRequest.getParameter(HttpRequest.java:293) at org.apache.cocoon.environment.wrapper.RequestWrapper.getParameter(RequestWrapper.java:150) at org.apache.cocoon.matching.RequestParameterMatcher.match(RequestParameterMatcher.java:91) I think this is because one of the pipelines I use has an optional parameter, and when the parameter isn't there the null parameter is still attempted to be decoded ... Anyway, my platform is RedHat 7.2, jdk 1.3.1_04, JBoss-2.4.7_Jetty-4.0.4, and of course Cocoon 2.0.2. Please keep those suggestions coming, just in case I don't knock myself out with the repeated banging of my head against a wall ... Thanks Kenneth On Wed, 2002-09-18 at 16:15, Antonio Gallardo Rivera wrote: Take it easy, baby! We are trying to help not to fight ;) Do you read my post about how is the file really stored in the hard disk? Are you sure that your XML, XSP, XSL files are stored in your required format? I told you that because when I started with Cocoon. I had the same problem. What plataform are you using? Antonio Gallardo. - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faq/index.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]