You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by fa...@spline.de on 2004/07/25 14:14:35 UTC

Weired problems with character encoding (UTF-8)

Hello Fellows,

I'm desperate an neeed help.
I've tried the whole night to get my
turbine application running with utf-8 support.
It's really strange. I've got problems with form submitted
data and maybe also storing and retrieving this data from
mysql in utf-8. I'm not exactly sure where the problem arises. It behaves in ways I dont't understand.

I stumbled through various prevouis posting 
and basicaly tried all of the suggested options without 
success.
I'm quite confused about the various options concerning 
utf-8 and couldn't find a clear explanation about how utf-8
is handled in the various stages of processing (Browser 
posting, Paramater parsing in Turbine, mysql-jdbc 
storing/retrieving, displaying with velocity...).

I really need help.
Could someone show me a way to test the involved components step by step and pinpoint the error.

If you neeed more information please tell me.

Thanks in advance,
Fabian

P.S.
I'm using tomcat 5.27, MySQL 4.0.18, turbine 2.3 on WindowsXP. And my options concerning utf-8 are for now:

torque.properties:
########
torque.defaults.connection.driver =   org.gjt.mm.mysql.Driver
torque.defaults.connection.url =       	jdbc:mysql://bernd/rulapro?useUnicode=true&characterEncoding=UTF-8&mysqlEncoding=utf8

project.properties
##############
services.VelocityService.output.encoding=UTF-8
#services.VelocityService.input.encoding=UTF-8
services.VelocityService.default.contentType=text/html; charset=utf-8
locale.default.charset=UTF-8

Parameterparsing:
############
//I'm the following to get the posted form data right now.
p = data.getParameters()
p.setCharacterEncoding("UTF-8");




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Weired problems with character encoding (UTF-8)

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
fabian-turb@spline.de writes:

>Hello Fellows,

>I'm desperate an neeed help.
>I've tried the whole night to get my
>turbine application running with utf-8 support.
>It's really strange. I've got problems with form submitted
>data and maybe also storing and retrieving this data from
>mysql in utf-8. I'm not exactly sure where the problem arises. It behaves in ways I dont't understand.

- make sure that your pages sent out by the web container really contain
  UTF-8 as charset encoding (check with wget)
- make sure that in the header there is no ISO-8859-1 embedded
- Your browser must support UTF-8 (current Mozilla and IE do)
- If you use postgres, don't create your database with SQL_ASCII or LATIN1
  as encoding

I've been through this before and yes, it can be hell. :-) Turbine itself 
runs fine on UTF-8, though. 

What kind of container are you using? Plain Tomcat (then it's best to use 
Tomcat5) or Tomcat + Apache? Or something else?

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Weired problems with character encoding (UTF-8)

Posted by David Demner <tu...@demner.com>.
Hi Fabian,

I seem to remember a post about specifying accept-charset="UTF-8" in your
form declaration.

Also, check out http://www.oop-reserch.com/mysql.html which basically says
that unless mysql was compiled with non-ascii support it will corrupt
non-ascii strings.

Good luck,

David

-----Original Message-----
From: fabian-turb@spline.de [mailto:fabian-turb@spline.de] 
Sent: Sunday July 25, 2004 5:15 AM
To: turbine-user@jakarta.apache.org
Subject: Weired problems with character encoding (UTF-8)


Hello Fellows,

I'm desperate an neeed help.
I've tried the whole night to get my
turbine application running with utf-8 support.
It's really strange. I've got problems with form submitted
data and maybe also storing and retrieving this data from
mysql in utf-8. I'm not exactly sure where the problem arises. It behaves in
ways I dont't understand.

I stumbled through various prevouis posting 
and basicaly tried all of the suggested options without 
success.
I'm quite confused about the various options concerning 
utf-8 and couldn't find a clear explanation about how utf-8
is handled in the various stages of processing (Browser 
posting, Paramater parsing in Turbine, mysql-jdbc 
storing/retrieving, displaying with velocity...).

I really need help.
Could someone show me a way to test the involved components step by step and
pinpoint the error.

If you neeed more information please tell me.

Thanks in advance,
Fabian

P.S.
I'm using tomcat 5.27, MySQL 4.0.18, turbine 2.3 on WindowsXP. And my
options concerning utf-8 are for now:

torque.properties:
########
torque.defaults.connection.driver =   org.gjt.mm.mysql.Driver
torque.defaults.connection.url =
jdbc:mysql://bernd/rulapro?useUnicode=true&characterEncoding=UTF-8&mysqlEnco
ding=utf8

project.properties
##############
services.VelocityService.output.encoding=UTF-8
#services.VelocityService.input.encoding=UTF-8
services.VelocityService.default.contentType=text/html; charset=utf-8
locale.default.charset=UTF-8

Parameterparsing:
############
//I'm the following to get the posted form data right now.
p = data.getParameters()
p.setCharacterEncoding("UTF-8");




---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org