I'm using gettext and UTF-8 for translation of my website.
But for a reason special norwegian chars like æ, ø and å is fucking up.
All PHP-files are encoded with UTF-8.
I generate with these commands:
rm /usr/share/locale/nb/LC_MESSAGES/myfile.mo
msgfmt -c -v -o /usr/share/locale/nb/LC_MESSAGES/myfile.mo no.po
/etc/init.d/lighttpd restart
Start of my no.po file:
# Norwegian Bokmal translations for PACKAGE package.
# Copyright (C) 2007 THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# root <my@email.com>, 2007.
#
#: ../gettext.php:2
msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-09-28 16:38+0200\n"
"PO-Revision-Date: 2007-09-23 12:06+0200\n"
"Last-Translator: root <my@email.com>\n"
"Language-Team: Norwegian Bokmal\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: ../lib/form.php:147 ../lib/form.php:194
msgid " cannot be empty"
msgstr " kan ikke være tom"
In my PHP file I use this as header:
$lang = 'no_NO';
header('Content-Type: text/html; charset=UTF-8');
date_default_timezone_set('Europe/Oslo');
putenv("LC_ALL=$lang");
setlocale(LC_ALL, $lang);
textdomain('mydomain');
And this in my <head>:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Where should I start troubleshoot?