Gossamer Forum
Home : Products : DBMan : Customization :

converting special characters

Quote Reply
converting special characters
Hi

A problem I have got with FileMan also affects DBMan (and Links for that matter), and I would like to fix it for a couple of sites where I have DBMan installed as news databases. Basically the problem is that things like &s get messed up, more info here:

http://www.gossamer-threads.com/...um7/HTML/000088.html

Anyone fancy doing a little bit of perl to enable it to be fixed?

Chris
Quote Reply
Re: converting special characters In reply to
Sorry I missed your post yesterday. Sometimes that happens.

You can set it up to substitute the html equivalents. I'm sure there's an easier way to do this, but this is all I can think of right now.

Code:
$character[0] = '©';
$substitute[0] = '& copy;';
for ($i=0; $i<= $#character; ++$i) {
$text =~ s/$character[$i]/$substitute[$i]/g;
}

You would need to define the variables for each special character you wanted to convert.


------------------
JPD