Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Weird charachter?

Quote Reply
Weird charachter?
Hi. I don't suppose anyone knows what is going on here? I have the following code in my link.html template;

Code:
<td><font color="green"><%if Price%><%mod_price%><%endif%></font></td>

... and that returns;

Quote:
<td>£<font color="green">10</font></td>

I've even tried a global, to replace the with a blank charachter! Its driving me mad!

TIA.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird charachter? In reply to
Seems to be down to this Plugin routine...

Code:
# Needs to be called with <%Plugins::Overture::Show_Overture($ID,5)%>
# herei s where we do the Overture search stuff...
sub Show_Overture {

my $CatID = $_[0];
my $Limit = $_[1];

my $table = $DB->table('Category');
my $sth = $table->select( { ID => $CatID } );
my $Keyword;

while (my $hit = $sth->fetchrow_hashref) {
$Keyword = $hit->{Keyword};
}

my $page = get("http://xml.uk.overture.com/d/search/p/partner/xml/fast/?mkt=uk&maxCount=10&Partner=site_xml_uk_test&Keywords=$Keyword");

my $ref = XMLin($page);

#work out how many listings we have...
my $Count;
for (my $i = 0; $i <= 10; $i++) {
if ($ref->{ResultSet}->{Listing}->[$i]->{title}) { next; } else { $Count = $i - 1; }
}

# just a fail safe, in case we get more links than we actually want to show...
if ($Count > $Limit) { $Count = $Limit - 1; }

# now lets go through, and create the HTML for it...
my $html_links;
for (my $count = 0; $count <= $Count; $count++) {

# get the variables all setup...
my $Description = $ref->{ResultSet}->{Listing}->[$count]->{description};
my $Title = $ref->{ResultSet}->{Listing}->[$count]->{title};
my $URI = $ref->{ResultSet}->{Listing}->[$count]->{ClickUrl}->{content};
my $ClickURL = $ref->{ResultSet}->{Listing}->[$count]->{siteHost};

# put the links into HTML format...
$html_links .= Links::SiteHTML::display('overture_link', { Description => $Description, Title => $Title, URL => $URI, ShowURL => $ClickURL });

}

# now lets send it back to the template....
return $html_links;

}

Can anyone see why this would cause the to change to a '£' ? Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird charachter? In reply to
Hi Andy,

I've tried using the symbol in a variety of situations and have no problem. I wonder if it has something to do with the font you are using?

Alba
Quote Reply
Re: [Alba] Weird charachter? In reply to
Hi,

That's most likely what's happening. A font substitution that doesn't return the expected character.

Try a different font -- force it to verdana or arial and see what happens.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Weird charachter? In reply to
If I remove the plugin tag... it works fine. I don't think its anything to do with the font Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird charachter? In reply to
get("http://xml.uk.overture.com.....

Did you check the headers on that page? It might be changing the default character set, or font.

Try forcing the font, and see what happens.




PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Weird charachter? In reply to
Tried defining TNR and Tahoma, and neither of them sorted it. This is mad.. WHY is it doing this! Mad

Thanks for the ideas though.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Weird charachter? In reply to
Reminds me of similar problems I have had in the past, after scraping markup off another site.

It's not your font. It's probably related to your character set/encoding. Looks like the source markup may be using two bytes for characters, ie: Unicode encoding.

Do you have a charset meta tag in your page header? eg: something like -
Code:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Try using
Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
instead.

These resources
http://www.cs.tut.fi/~jkorpela/chars.html
http://www.alanwood.net/unicode/
might help.
Quote Reply
Re: [YoYoYoYo] Weird charachter? In reply to
You're a geniouse! It works a charm Smile

Thanks a ton.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!