+5  A: 

You can try something like HTML::Entities. From the POD:

use HTML::Entities;
$a = "Våre norske tegn bør &#230res";
decode_entities($a);
#encode_entities($a, "\200-\377");  ## not needed for what you are doing

In response to your edit, HTML::Entities is not in the perl core. It might still be installed on your system because it is used by a lot of other libraries. You can check by running this command:

perl -MHTML::Entities -le 'print "If this prints, the it is installed"'
gpojd
Actually that would be great if I coulc use Cpan to install it, but they do not let me :(I edited the question after I read your answer.
mandel
I updated my answer on how to check if it is already installed. With any luck, it will already be there.
gpojd
Thanks!!! I forgot to check if it was present in the server.... but the command I executed is <b>perl -MHTML::Entitie -e l</b> yours gave me an error... maybe is just because I'm working on a windows server ;)
mandel
It almost looks like it was mangled in the copy/paste. Either way, I'm glad that worked for you.
gpojd
Hmm... I think a perl script just containing this would work, too: print "If this prints, it is installed" if (eval(use HTML::Entities));
R. Bemrose
A: 

I don't suppose it's possible to make TeamSite leave it as utf-8/convert it to utf-8?

CGI.pm has an (undocumented) unescapeHTML function. However, since it IS undocumented (and I haven't looked through the source), I don't know if it just handles basic HTML entities (<, >, &) or more. However, I'd GUESS that it only does the basic entities.

R. Bemrose
+1  A: 

For your purpose is HTML::Entities far best solution but if you will not found some existing package fits your needs following approach is more effective than multiple s/// statements

# this part do in inter function module code which is executed in compile time
# or place in BEGIN or do once before first s/// statement using it
my %trans = (
  'Aacute;' => 'Á',
  'aacute;' => 'á',
  'Agrave;' => 'À',
  'Acirc;' => 'Â',
  'agrave;' => 'à',
); # remember you can generate parts of this hash for example by map

my $re = qr/${ \(join'|', map quotemeta, keys %trans)}/;

# this code place in your functions or methods
s/($re)/$trans{$1}/g; # 'o' is almost useless here because $re has been compiled yet

Edit: There is no need of e regexp modifier as mentioned by Chas. Owens.

Hynek -Pichi- Vychodil
thanks, the module is installed in one of the server, but apparently that does not mean it will be in all of them... sigh I hate the people that take care of security in the company
mandel
A: 

Why should someone be fired for putting XSL, which is XML, into an XML file?

AmbroseChapel
mandel