perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel CROMBEZ <ecrom...@lanthrasites.com>
Subject Re: Encoding problem
Date Fri, 23 Apr 2010 07:49:39 GMT
Hello

My solution for UTF-8 problem in web page are in 3 steps:
1 - fixe content-type
2 - fixe xml encoding
3 - fixe html header encoding

In mod_perl , use
  
  $r->content_type('text/html; Charset=UTF-8');

The first line of your html page must be :

  <?xml version="1.0" encoding="UTF-8" ?>

And in the <head> you must have :

  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

If you doesn't have this 3 lines, some part of your page works and other
doesn't. For exemple if you don't set the <?xml>, the title of your page
doesn't work all the time.

I write article in my blog (in french) here : 
http://ecrombez.lantrasite.com/index.pl?PAGE=53&ID_BILLET=115

Le vendredi 23 avril 2010 à 09:27 +0200, kolikov a écrit :
> Jean-Christophe Boggio wrote:
> > ? The problem comes from the header I *receive*. The headers I send are
> > always good (hard coded in base.epl). I'm quoting myself :
> >
> >> <meta http-equiv="content-type" content="text/html; charset=utf-8">
> 
> If it may help :
> 
> All my scripts are written in utf-8 encoding
> My default system/database locales are utf-8
> My apache2.conf is the default one
> 
> # cat /etc/apache2/sites-available/mysite
> <Directory /var/www/mysite>
>   AddDefaultCharset utf-8
> ETC ....
> </Directory>
> 
> My html headers are the same as yours.
> But I put on Every <form>
> 
> <form action="xx.html"  method="post" accept-charset="UTF-8">
> 
> Which may make the point ...
> 
> Bregs,
> Romu.
> 



Mime
View raw message