LabourStart has recently converted its news links database to Unicode. As we now work in 22 languages, it’s important that we be able to show characters correctly — including in our lists of languages displayed at the top of every page on the site.
But … most union websites don’t use Unicode. And the JavaScript newswires we created, which now generate Unicode characters, were causing problems. So we’ve gone into the script which creates the JavaScript every 30 minutes and told it to convert Unicode back into character encodings like iso-8859-1 (for Western languages), windows-1251 (for Russian), etc.
The problem is, while this works like a charm on the Russian, it’s not working on Norwegian — or not converting all the characters, not even all the comon ones.
Here is a page showing the current Norwegian JavaScript newswire. To see the characters correctly displaying in Unicode, go here.
We’re using a Perl module – Text::Iconv to do this. Here is the code:
if ($langcode eq “no”) {$converter = Text::Iconv->new(“utf-8″, “iso-8859-1″);}
$Header = $converter->convert(“$Header”);
Can anyone help sort this out for us?