You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2006/02/07 14:37:48 UTC
Forms encoding problem
I am struggling to get forms displayed on a server -
UNIX machine running Cocoon 2.1.5 and JDK 1.4
(the same app works **fine** on the development
machine, running the same configuration, as well as
on a Linux server...)
The error message I get when trying to show the form
(filled with data from the database) is:
org.apache.cocoon.ProcessingException:
Failed to execute pipeline.:
java.lang.RuntimeException:
org.xml.sax.SAXException:
Attempt to output character of integral value 160 that is not represented in specified output encoding of .
[and no, there is no word missing just before the above "full stop"]
Based on mailing list and wiki suggestions I have tried:
<form action=... method="post" accept-charset="ISO-8859-1">
also:
<?xml version="1.0" encoding="ISO-8859-1"?>
in the form, *and* the stylesheet processing the form for display
also, in cocoon.xconf
<jdbc name="pool_name">
<pool-controller min="5" max="10"/>
<dburl>jdbc:mysql://YourHostName:3360/YourDataBaseName?useUnicode=true&characterEncoding=ISO-8859-1</dburl>
<user>database_user</user>
<password>database_password</password>
</jdbc>
NB - I am not trying to use any complex characters - inputs
should be "plain" English!
Is there a "Definitive Guide to Using Encoding" anywhere??
Thanks
Derek
--
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.
CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html
CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html
For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
HelpDesk@csir.co.za.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Forms encoding problem
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 7 févr. 06, à 14:37, Derek Hohls a écrit :
> ...Attempt to output character of integral value 160 that is not
> represented in specified output encoding of ...
Might be related to your JVMs running with different default encodings.
The JVM's default encoding can be set with the file.encoding system
property, for example -Dfile.encoding=utf-8 on the JVM command line.
-Bertrand
Re: Forms encoding problem
Posted by Thomas Lutz <ma...@gmx.at>.
first thought:
i think we had this error message when using escaped utf-8 chars...
our source files are encoded in utf-8, and some guy inserted a escaped
" " in utf 8 with is in utf-8 (<!ENTITY *nbsp* " ">)
this crashed the forms. didn't figure out why, not enough time, just
threw out the escaped chars. but as you are using iso-8859-1, just
search for a file that's not in the right encoding, or a string 160 in
your form files and delete this... (ultraedit or grep, depending on your
system :-) ) probably one of your coders or editors uses utf-8, so
you'll accidently inserted this utf-8 fragment (and doesn't know it :-) )
second thought:
are you sure that the configuration is the same ? maybe the app server
has other defaults, that you don't set in your application config... no
server admin guru, but we had problems in this area.
Maybe it helps to set some init-params in web.xml, here comes a snippet
from my app (replaced my setting utf-8 with your setting iso-8859-1)
<!--
Set encoding used by the container. If not set the ISO-8859-1 encoding
will be assumed.
-->
<init-param>
<param-name>container-encoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
<!--
Set form encoding. This will be the character set used to decode
request
parameters. If not set the ISO-8859-1 encoding will be assumed.
-->
<init-param>
<param-name>form-encoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
hth,
tom
Derek Hohls wrote:
> I am struggling to get forms displayed on a server -
> UNIX machine running Cocoon 2.1.5 and JDK 1.4
> (the same app works **fine** on the development
> machine, running the same configuration, as well as
> on a Linux server...)
>
> The error message I get when trying to show the form
> (filled with data from the database) is:
>
> org.apache.cocoon.ProcessingException:
> Failed to execute pipeline.:
> java.lang.RuntimeException:
> org.xml.sax.SAXException:
> Attempt to output character of integral value 160 that is not represented in specified output encoding of .
>
> [and no, there is no word missing just before the above "full stop"]
>
> Based on mailing list and wiki suggestions I have tried:
>
> <form action=... method="post" accept-charset="ISO-8859-1">
>
> also:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> in the form, *and* the stylesheet processing the form for display
>
> also, in cocoon.xconf
>
> <jdbc name="pool_name">
> <pool-controller min="5" max="10"/>
> <dburl>jdbc:mysql://YourHostName:3360/YourDataBaseName?useUnicode=true&characterEncoding=ISO-8859-1</dburl>
> <user>database_user</user>
> <password>database_password</password>
> </jdbc>
>
>
> NB - I am not trying to use any complex characters - inputs
> should be "plain" English!
>
> Is there a "Definitive Guide to Using Encoding" anywhere??
>
> Thanks
> Derek
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Forms encoding problem
Posted by Simone Gianni <s....@thebug.it>.
Hi Derek,
I encountered encoding problems here and there in java for a long time,
because the JVM could not be enabled to use UTF-8 correctly because the
underlying libc is not UTF-8 (or any other encoding) aware, expecially
on Linux/*nix machines.
Since you are having this problem on a certain server, are you sure the
JVM in that server is able to actually read/write UTF-8? you could write
a very simple class with a main which loads or writes a file and/or to
screen in UTF-8, and see if the JVM itself properly handles the UTF-8
encoding.
On older linux distributions (Debian potato, RedHat up to 6) you had to
generate the locales, on modern linux distributions setting LC_ALL and
LANG environment variables to, say, en_GB.UTF-8 tells the system which
encoding is the default one. I don't know how the unix on that server
handles this.
Not sure this is your case, but it worth a try.
Regars,
Simone
--
Simone Gianni
Derek Hohls wrote:
>I am struggling to get forms displayed on a server -
>UNIX machine running Cocoon 2.1.5 and JDK 1.4
>(the same app works **fine** on the development
>machine, running the same configuration, as well as
>on a Linux server...)
>
>The error message I get when trying to show the form
>(filled with data from the database) is:
>
>org.apache.cocoon.ProcessingException:
>Failed to execute pipeline.:
>java.lang.RuntimeException:
>org.xml.sax.SAXException:
>Attempt to output character of integral value 160 that is not represented in specified output encoding of .
>
>[and no, there is no word missing just before the above "full stop"]
>
>Based on mailing list and wiki suggestions I have tried:
>
> <form action=... method="post" accept-charset="ISO-8859-1">
>
>also:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
>in the form, *and* the stylesheet processing the form for display
>
>also, in cocoon.xconf
>
> <jdbc name="pool_name">
> <pool-controller min="5" max="10"/>
> <dburl>jdbc:mysql://YourHostName:3360/YourDataBaseName?useUnicode=true&characterEncoding=ISO-8859-1</dburl>
> <user>database_user</user>
> <password>database_password</password>
> </jdbc>
>
>
>NB - I am not trying to use any complex characters - inputs
>should be "plain" English!
>
>Is there a "Definitive Guide to Using Encoding" anywhere??
>
>Thanks
>Derek
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org