Gossamer Forum
Home : General : Perl Programming :

encoding ampersand

Quote Reply
encoding ampersand
i'm running the w3.org validator on my pages and get an error about a text value (AT&T) having an unencoded ampersand. wondering whether it would be better to encode before i save the record value or encode each time i want to display. thinking i should do it when i save because that is less frequent. what do you think?
Quote Reply
Re: [delicia] encoding ampersand In reply to
You are encoding & as &

----
Cheers,

Dan
Founder and CEO

LionsGate Creative
GoodPassRobot
Magelln
Quote Reply
Re: [delicia] encoding ampersand In reply to
Hi,

It's up to you. Personally, I would leave it as &, and then only convert it when you are rendering the contents.

Code:
$foo =~ s/&/&/g;

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] encoding ampersand In reply to
i am encoding only when displaying the record. so the record is stored as "Testing & Quality Assurance". i have just discovered that when i search that field for that exact match, I'm getting no matches. this is a category that i'm selecting when i enter a record so it should be exact match! can't figure out why it isn't finding. any suggestions where i should look?
Quote Reply
Re: [delicia] encoding ampersand In reply to
Hi,

You would need to add some debugging into the script, to try and find out what exactly it is searching for. I'm assuming this is for DBMan? If so, I don't really know the inner workings of that I'm afraid.,

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] encoding ampersand In reply to
the problem was the line that encoded when rendering. that line was also used during searches so seach was looking for & so i made a new sub just for searches that didn't use that line.