Page 2 of 2

Re: How to display ISO-8859-1 RSS correct

Posted: Sun Oct 29, 2006 8:39 pm
by avegard
Well,... I didnt mange to work this out myself, so my cousin did this code for me

Code: Select all

		$bytt = array("Æ", "Ø", "Å", "æ", "ø", "å");
		$ny  = array("Æ", "Ø", "Å", "æ", "ø", "å");
			
		$data = str_replace($bytt, $ny, $data);   	

It worked on the link at least, which will be all that I use, so I am good for now.

Re: How to display ISO-8859-1 RSS correct

Posted: Wed Mar 21, 2007 2:26 am
by Nettie
Can anybody please tell me what exactly I have to do to get this Pirss working? I need to use the characters æ ø å. Should I install the pirss in the earlier mentioned folders and what do I have to edit in those files???

I am using the formbuilder module and the users of the site has to be able to insert the above letters. Should I change the utf-8 to ISO-8859-1 while I have installed pirss?

I am a bit confused and not so good in php yet - just started!!!

Hope anybody can help me out here, as it is really buggin me that I can't get it working. I would hate to have to change to a different system because of that little detail, as I really love CMS Made Simple a lot.

??? ??? ??? :o

Re: How to display ISO-8859-1 RSS correct

Posted: Sat May 19, 2007 6:25 pm
by avegard
Yes, you can change the function.pirss.php file.

Code: Select all

<?
function smarty_cms_function_pirss($params, &$smarty)
{
  $url = isset($params['url']) ? $params['url'] : 'http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml';
  //$encoding = isset($params['encoding']) ? $params['encoding'] : '';
  $max_news = isset($params['maxnews']) ? $params['maxnews'] : 10;
  $data = implode('', @file($url));
  $outar=array();
  $io=-1;
  if ($data)
  {
     //if ($encoding && function_exists('mb_convert_encoding')) {$data = mb_convert_encoding($data, 'utf-8', 'ISO-8859-1');}
     //$data=str_replace('å','å',$data);


		if ($url == "http://www.esbenfjord.dk/bibfeed/norgefeed.xml" || $url == "http://www.url2.com" || $url == "http://www.url3.com"){

			$bytt = array("À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß",
			"à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");
			$ny  = array("À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß",
			"à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "ø", "ù", "ú", "û", "ü", "ý", "þ", "ÿ");

			$data = str_replace($bytt, $ny, $data);
		}
Insert this in the top of the file, also replacing the original 13 (?) lines. There is indeed a much more easy (and correct) method to get this done, but I don't remember it. This should work until then.

Re: How to display ISO-8859-1 RSS correct

Posted: Sun Mar 23, 2008 5:06 am
by jannikbc
I had/have the same problem with æ/ø/å in menu's and espesially in FeedBackForms.... I have no idea what you are talking about, but tomorrow, when I'm sober again, I'll test all your codes - it seams like you have some notion of the problem, at least.

My deadline's the day after tomorrow. Argh! 69!

Re: How to display ISO-8859-1 RSS correct

Posted: Sun Mar 23, 2008 10:44 am
by alby
jannikbc wrote: I had/have the same problem with æ/ø/å in menu's and espesially in FeedBackForms...
Attention, FeedBackForms is deprecated (in favor of Formbuilder module)

Alby