Page 1 of 1
News module categories with scandinavian alphabets
Posted: Fri Aug 18, 2006 10:00 am
by noname
I have some news categories which have letters ä and ö (a and o with umlauts) in their name. If I try to show some of these categories with {news category='name_with_umlauts_here'} it doesn't show any news articles at all - seems that it doesn't get any articles from SQL. If the name doesn't have any of these scandinavian alphabets in it, it works correctly. And if I view all categories (by leaving the category-part out), it works correctly. I am using latest 1.0 beta.
Is there a way to make these "special charactered" categories to work?
Re: News module categories with scandinavian alphabets
Posted: Wed Aug 23, 2006 10:47 pm
by tsw
this is most probably a problem with mysql server not using utf8 encoding. you might need to convert text to html entities for it to work properly or change your mysql to use utf8
Re: News module categories with scandinavian alphabets
Posted: Thu Aug 24, 2006 6:38 am
by noname
Actually I figured this out just a couple of minutes ago and it's quite simple if you think about it: MySQL is using utf8 but the thing is that when I save a line like "{news category='Työntekijä'}" with FCKEditor, it actually saves "{news category='Työntekijä'}". And there's no category by that name.
I solved this by replacing all the ä with ä's and so on in variable $onecat in modules/News/action.default.php (somewhere around line 49 or so, inside a foreach loop) and right after that I had to utf8_encode($onecat).
Is this a bug or am I not getting it right?
Re: News module categories with scandinavian alphabets
Posted: Thu Aug 24, 2006 7:43 am
by tsw
You could file a bug about it (check that there isnt one first ;)
Re: News module categories with scandinavian alphabets
Posted: Thu Aug 24, 2006 8:12 am
by noname