Home of the Squeezebox™ & Transporter® network music players.

Go Back   Squeezebox : Community : Forums > User Forums > 3rd Party Plugins
User Name
Password

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2005-11-19, 09:24
Milhouse Milhouse is offline
Senior Member
 
Join Date: Jul 2005
Posts: 244
Milhouse is on a distinguished road
Default AlienBBC - accented characters problem?

When scrolling the the available AlienBBC streams on my SB2, non-English streams are fairly unreadable (even to a Gaelic speaker!) as the stream title contains HTML entities and not the correctly accented characters. As an example, try navigating to:

Internet Radio -> AlienBBC -> Radio nan Gaidheal

then while scrolling through the list of streams - you will see:

Èist beò
A' mire ri M& #242;r
Caithream Ci& #249;il
etc.

I'm not sure if this is a problem with AlienBBC, or a general User Interface problem with the Squeezebox. Can it be fixed? Or I may have to complain to my local MP about regional discrimination!
Reply With Quote
  #2  
Old 2005-11-19, 09:53
Neil Sleightholm Neil Sleightholm is offline
Senior Member
 
Join Date: Apr 2005
Posts: 587
Neil Sleightholm is on a distinguished road
Default

I have just had a look at this and I think it displays ok in my browser. The first title is: ÈIST BEÒ without any #xx; bits. What browser are you using?

Neil
Reply With Quote
  #3  
Old 2005-11-19, 10:06
Milhouse Milhouse is offline
Senior Member
 
Join Date: Jul 2005
Posts: 244
Milhouse is on a distinguished road
Default

Hi Neil

Browsers are fine - I'm using Firefox 1.5 - however the issue is with the actual display on the squeezebox itself, in my case an SB2.

I'm not sure if this is a general display issue with accented characters, or if perhaps AlienBBC is incorrectly formatting the display string that is passed to the SB for display?
Reply With Quote
  #4  
Old 2005-11-19, 14:59
Neil Sleightholm Neil Sleightholm is offline
Senior Member
 
Join Date: Apr 2005
Posts: 587
Neil Sleightholm is on a distinguished road
Default

Sorry I didn't read your post properlybut now I see what you mean. The code simply displays what the BBC displays and as this is web friendly you see the strange chars on the SB. I'll see if there is something we can do to fix this.

Neil
Reply With Quote
  #5  
Old 2005-11-19, 19:38
Milhouse Milhouse is offline
Senior Member
 
Join Date: Jul 2005
Posts: 244
Milhouse is on a distinguished road
Default

Fantastic - many thanks!
Reply With Quote
  #6  
Old 2005-11-20, 03:04
Neil Sleightholm Neil Sleightholm is offline
Senior Member
 
Join Date: Apr 2005
Posts: 587
Neil Sleightholm is on a distinguished road
Default

I have a fix for you. I you don't mind hacking could you try it. In the Plugins\Alien folder, edit the Plugin.pm file. Locate the code "sub lines" and then just before the final "return $parts;" insert for following:
Code:
	# Convert &xxx;and &#xxx; items to the correct character for display on the SB
	$parts->{line1} = HTML::Entities::decode_entities($parts->{line1});
	$parts->{line2} = HTML::Entities::decode_entities($parts->{line2});
Assuming you are using the latest version, the whole function will then look like this:
Code:
#
# Player display function
#
sub lines 
{
	my $client = shift;
	my $parts;

	if (defined $refreshing{$client} && $refreshing{$client} )
	{
		$parts->{line1} = '';
		$parts->{line2} = '';
		return $parts;
	}

	my $num_items = $current_menu{$client}->get_num_items();
	if ($num_items == 1)
	{
		$parts->{line1} = $current_menu{$client}->title();
	} 
	else 
	{
		$parts->{line1} = $current_menu{$client}->title() . " (" . ($current_line{$client}+1) . "/" . $num_items .")";
	}

	if ($num_items > 0) 
	{
		my $item = $current_menu{$client}->get_item($current_line{$client});
		$parts->{line2} = $item->get_text();
	
		if ($item->has_children()) 
		{
			$parts->{overlay2} = $client->symbols(Slim::Display::Display::symbol('rightarrow'));
		} 
		elsif ($item->is_playable()) 
		{
			$parts->{overlay2} = $client->symbols(Slim::Display::Display::symbol('notesymbol'));
		}
	} 
	else 
	{
		$parts->{line2} = Slim::Utils::Strings::string('PLUGIN_ALIENBBC_NO_ITEMS');
	}
	
	# Convert &xxx;and &#xxx; items to the correct character for display on the SB
	$parts->{line1} = HTML::Entities::decode_entities($parts->{line1});
	$parts->{line2} = HTML::Entities::decode_entities($parts->{line2});

	return $parts;
}
Neil
Reply With Quote
  #7  
Old 2005-11-20, 06:42
Milhouse Milhouse is offline
Senior Member
 
Join Date: Jul 2005
Posts: 244
Milhouse is on a distinguished road
Default

Neil - your patch works perfectly! That's fixed the problem for me, very much appreciated.
Reply With Quote
  #8  
Old 2005-11-20, 07:38
Neil Sleightholm Neil Sleightholm is offline
Senior Member
 
Join Date: Apr 2005
Posts: 587
Neil Sleightholm is on a distinguished road
Default

I'll make this patch part of future releases.
Reply With Quote
  #9  
Old 2005-11-20, 21:01
Milhouse Milhouse is offline
Senior Member
 
Join Date: Jul 2005
Posts: 244
Milhouse is on a distinguished road
Default

Actually I spoke too soon... the accented character problem is definately fixed when scrolling through the available streams, but the problem returns when a stream starts to play - the accented characters are displayed as HTML entities in "Now Playing".

There is a point in "%functions" at line 388 (v1.00) which may benefit from the addition of entity translation:

Code:
#				my $name = $menu_item->get_text();
				my $name = HTML::Entities::decode_entities($menu_item->get_text());

#				my $line2 = ($client->linesPerScreen() == 1) ? undef : lines($client)->{line2};
				my $line2 = ($client->linesPerScreen() == 1) ? undef : HTML::Entities::decode_entities(lines($client)->{line2});

				$client->showBriefly(Slim::Utils::Strings::string('PLUGIN_ALIENBBC_CONNECTING'), $line2, 10);
The above code change only corrects text that is displayed very briefly. Once the stream begins to play, "Now Playing" shows the stream title with the HTML entities.
Reply With Quote
  #10  
Old 2005-11-22, 02:45
Neil Sleightholm Neil Sleightholm is offline
Senior Member
 
Join Date: Apr 2005
Posts: 587
Neil Sleightholm is on a distinguished road
Default

I can't find a simple solution to this but I am still looking.

Neil
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 20:41.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.