Swedish characters in id3 artist field makes author tag in podcast feed empty.

Workaround that I got working:

Add following to the top of ffpc_row_plugin_podcast.inc

function unhtmlspecialchars($string)
{
 	$string = str_replace ( 'å', 'å', $string );
 	$string = str_replace ( 'Å', 'Å', $string ); 
 	$string = str_replace ( 'ä', 'ä', $string );
 	$string = str_replace ( 'Ä', 'Ä', $string );
 	$string = str_replace ( 'ö', 'ö', $string );
 	$string = str_replace ( 'Ö', 'Ö', $string ); 	 	
 	$string = str_replace ( 'å', 'å', $string );
 	$string = str_replace ( 'Å', 'Å', $string );
 	$string = str_replace ( 'ä', 'ä', $string );
 	$string = str_replace ( 'Ä', 'Ä', $string );
 	$string = str_replace ( 'ö', 'ö', $string );
 	$string = str_replace ( 'Ö', 'Ö', $string );   
 	return $string;
}  

Search for:

          'value' => $info['tags_html']['id3v2']['artist'][0], 

and replace the line with:

          'value' => unhtmlspecialchars($info['tags_html']['id3v2']['artist'][0]),

Maybe there is an better solution?

Comments

Nimo’s picture

Typo. You should search for $info['tags'] and replace with $info['tags_html'].

Ie:

Search for:

          'value' => $info['tags']['id3v2']['artist'][0],

Maybe there is an better solution?

and replace the line with:

          'value' => unhtmlspecialchars($info['tags_html']['id3v2']['artist'][0]),

Correct function to add:

function unhtmlspecialchars($string)
{
 	$string = str_replace ( 'å', 'å', $string );
 	$string = str_replace ( 'Å', 'Å', $string ); 
 	$string = str_replace ( 'ä', 'ä', $string );
 	$string = str_replace ( 'Ä', 'Ä', $string );
 	$string = str_replace ( 'ö', 'ö', $string );
 	$string = str_replace ( 'Ö', 'Ö', $string ); 	 	
 	$string = str_replace ( 'å', 'å', $string );
 	$string = str_replace ( 'Å', 'Å', $string );
 	$string = str_replace ( 'ä', 'ä', $string );
 	$string = str_replace ( 'Ä', 'Ä', $string );
 	$string = str_replace ( 'ö', 'ö', $string );
 	$string = str_replace ( 'Ö', 'Ö', $string );   
 	return $string;
}  

And for some reason my html-entities above got lost and was transformed into real characters - how to write them correctly?
(In the meanwhile replace & with &)

mfer’s picture

Status: Active » Needs work

This definitely needs work. The code listed here isn't really compatible with internationalization. This may be an issue with getID3 or our use of it.

mfer’s picture

Version: 6.x-0.7 » 6.x-2.x-dev
renoproc’s picture

Oh ! Didn't see this issue before... perhaps the swedish characters problems is the same as mine :
http://drupal.org/node/822584