hitesh
October 10, 2007, 12:58pm
1
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
hitesh
October 10, 2007, 1:37pm
2
I am using Apache with mongrel cluster.
hitesh
October 11, 2007, 7:37am
3
Hitesh wrote:
http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings
in .htaccess file.
Thanks
Hitesh
Are you setting something like this in your HTML files?:
How are you connecting Apache to your Rails app?
–
Michael W.
hitesh
October 17, 2007, 1:43pm
4
Yes Michael, I am setting 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
<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
-----------------Content of myapp.common include file
DocumentRoot /home/YouSearch/public
<Directory “/home/YouSearch/public”>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
RewriteEngine On
RewriteRule ^/$ /index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI}
[P,QSA,L]
AddOutputFilterByType DEFLATE text/html text/plain text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html