in reply to Re: utf-8 problem
in thread utf-8 problem

The file that the program reads is a tab delimited file with the first item being the special character and the second item being the html equivalent. Here is the file:
à Á á á Ã É Ã© Í; í í Ã Ñ Ã± ñ Ã Ó Ã³ ó Ã Ú Ãº ú Ã Ü Ã¼ ü ¿ ¿ ¡ ¡

Replies are listed 'Best First'.
Re^3: utf-8 problem
by eff_i_g (Curate) on Jan 29, 2009 at 22:21 UTC
    How about this?
    use HTML::Entities; use Encode; my $s1 = 'El supersónico de los Indi'; print "Start string: $s1\n"; my $s2 = encode_entities(decode('utf8', $s1)); print "End string: $s2\n";
Re^3: utf-8 problem
by kennethk (Abbot) on Jan 29, 2009 at 22:29 UTC
    1. eff_i_g has pointed out a nice wheel for you.
    2. I strongly suspect the file on your hard drive is not formatted like you think it is.
Re^3: utf-8 problem
by almut (Canon) on Jan 29, 2009 at 22:36 UTC

    That doesn't look like proper UTF-8 to me — though that might merely be a result of the various transformation steps involved in getting the file posted here.

    It would be better if you could show a hex dump of the file. For example, if you're on Linux, there's typically a tool called "hexdump" available, which you could use...