[wp-hackers] Little hack to add a proper UTF-8 support to 1.2

Michel Valdrighi m at tidakada.com
Fri Aug 20 23:38:04 UTC 2004


Le lun 16/08/2004 à 21:31, Pierre Machard a écrit :
> I needed to add a proper support of UTF-8 in my blog. I modified the
> file wp-blog-header.php to add:
> 
>         @header ('Content-Type: text/html; charset=utf-8');
> ^^^^^^^^^^^^^^^^^
> 
> I know that this hack is dirty, however could you please fix it in your
> next release.

WP does have proper UTF8 support. Your server is just badly configured.
That's how Debian's Apache comes anyway, since the stupid
AddDefaultCharset setting is there in the default httpd.conf file.

The fix you propose is a fix for a problem that lies in the server's
config, and it forces text/html as the MIME type.
Sadly, one can't specify a charset without specifying a MIME type, so WP
would have to either standardise on a MIME type (say hello to MIME type
pedants starting mass flamage of WP on their blogs about blogs about
blogging), or provide a pref (confusing).

A better workaround is to add this to the .htaccess rules WP creates:
AddDefaultCharset none

It wouldn't fix it for everyone (there's the cases when
AddDefaultCharset is set and the user can't create/modify a .htaccess
file), but it would at least be a cleaner fix.

Or maybe someone has a definitive fix that doesn't involve mingling with
MIME types?

-- 
Michel Valdrighi
http://zengun.org/weblog/




More information about the hackers mailing list