I can't reopen the discussion in Google Groups, so I'm posting a new
discussion to answer it:
> $gpscaption = Get(This_Image,"cap") ;
> $gpsurl='<a href=\'http://maps.google.co.uk/?q='.$psposition.'
> ('.$gpscaption.') &z=13 &t=h &output=embed\'>geotag</a>' ;
>
>
> which has produced
>
> <a href='http://maps.google.co.uk/?q=13.2675037333011 -59.5940297600167
> (A caption's apostrophe) &z=13 &t=h &output=embed'>geotag</a>
I don't know if you've solved this yet, but couldn't you just do:
$gpscaption = Get(This_Image,"cap") ;
$gpscaption =~ s/'/'/g;
That should solve the problem for you.
Thanks for the response. What I used was:
$gpscaption = Get(This_Image,"cap") ;
@badustuff = qw(< > & ' ") ;
@goodustuff = ("%3C", "%3E", "%26", "%27", "%22") ;
for (my $uctr = 0 ; $uctr <= $#badustuff ; $uctr++)
{
$gpscaption =~ s/$badustuff[$uctr]/$goodustuff[$uctr]/g ;
}
I suspect that that is not the way to do it in Perl though.
I seem to remember that it needed the % syntax rather than the &# syntax
as that is what google maps required.
Alan