Problems with special characters

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
olavt

Problems with special characters

Post by olavt »

I have some strange problems with characters like æ, ø and å, characters we use in Norwegian.

When I use CMSMS "out of the box", there are no problems. But I am using an external database, or rather other tables in the same database as CMSMS and these data are accessed via user defined tags. This tags may be like this:

"$categories = @mysql_query('SELECT * FROM zwpot_categories WHERE cat_ID>2  ORDER BY cat_name');

while ($row = mysql_fetch_array($categories)) {
  echo ''. $row['cat_name'] .'
';}"

What this tag should do is to extract headlines from articles stored in the WordPress tables and display them in CMSMS.

The result can be seen in http://www.torvund.net/index.php?page=test&catid=3

In words extracted from the database, these characters are subsituted with �.

If I just make a simple tag like "echo 'a,ø,å,Æ,Ø,Å'; they display correctly, as they do if I use them on a page in CMSMS. And in the database these characters are stored as they are and should be.

They also display correctly when viewed in WordPress.

The line "Klassisk musikk �ker p� nett" from http://www.torvund.net/index.php?page=test&catid=3 is the headline from http://blogg.torvund.net/2007/09/20/kla ... r-pa-nett/ selected from the same field in the database.

Does anyone have any idea where the problem is?
faglork

Re: Problems with special characters

Post by faglork »

Hi,

I had a similar problem. I think this is caused by the database data being encoded in ISO-xxxx rather than UTF8.

So I used HTMLENTITIES to convert the data to UTF8:
$text = htmlentities($text, ENT_QUOTES, UTF-8);
Maybe this will work in your case as well.

HTH,
Alex
olavt

Re: Problems with special characters

Post by olavt »

The database says that the characterset is UTF-8 Unicode (utf8), so I do not think that this is the problem.
Locked

Return to “CMSMS Core”