Unicode character handling

Hi,

I developing a web application using ruby on rails, apache 2.2.3 and Mysql. I want to handle the unicode characters(chinese, japanese etc.) in my application.

I have made the necessary configuration in application.rb , environment.rb and database.yml and .htaccess files. Also I am using encodeURIComponent fuction on javascript to escape the querystrigs.

http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings

Now I am able to store the unicode characters in the Mysql database with utf8 charset when I use webrick server.

But with apache I am getting ???(question marks) or illegal characters in the databas.

Can anybody help for handling the unicode charactes using Apache.

I am also using AddDefaultCharset utf8 in httpd.conf as well in .htaccess file.

Thanks

Hitesh

I am using Apache with mongrel cluster.

Hitesh wrote:

Hi,

I developing a web application using ruby on rails, apache 2.2.3 and Mysql. I want to handle the unicode characters(chinese, japanese etc.) in my application.

I have made the necessary configuration in application.rb , environment.rb and database.yml and .htaccess files. Also I am using encodeURIComponent fuction on javascript to escape the querystrigs.

http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings

Now I am able to store the unicode characters in the Mysql database with utf8 charset when I use webrick server.

But with apache I am getting ???(question marks) or illegal characters in the databas.

Can anybody help for handling the unicode charactes using Apache.

I am also using AddDefaultCharset utf8 in httpd.conf as well in .htaccess file.

Thanks

Hitesh

Are you setting something like this in your HTML files?:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

How are you connecting Apache to your Rails app?

Yes Michael, I am setting <meta http-equiv="content-type" content="text/html; charset=utf-8" /> in my html files.

I made following entry in httpd.conf file for hosting my application on apache.

<VirtualHost *:80> ServerName 172.16.0.144 ServerAlias 172.16.0.144

Include conf/extra/myapp.common

</VirtualHost>

<Proxy balancer://mongrel_cluster> BalancerMember http://127.0.0.1:8000 BalancerMember http://127.0.0.1:8001 BalancerMember http://127.0.0.1:8002 BalancerMember http://127.0.0.1:8003 BalancerMember http://127.0.0.1:8004 BalancerMember http://127.0.0.1:8005 BalancerMember http://127.0.0.1:8006 BalancerMember http://127.0.0.1:8007 BalancerMember http://127.0.0.1:8008 BalancerMember http://127.0.0.1:8009 </Proxy>

-----------------Content of myapp.common include file