in reply to Re: accents and diacritical marks in a web page
in thread accents and diacritical marks in a web page

1. what does "like crap" mean?
like crap means
explora el complejo dinámico entre la gente y la conservación como parte de la misión instead of explora el complejo dinámico entre la gente y la conservación como parte de la misión
2. your html <meta> tag claims the HTML printed from your perl code is utf-8 encoded...
that means I don't know UTF from my butt. I was simply trying different meta tags to try and make my web page claim something that would be understood by my browser -- I tried utf-8 along with x-mac-roman as well as iso-8859-1. I was just shooting in the dark hoping something will stick until I got the brilliant idea that I should ask those who know more than I do, that is, you monks.

update: and note my OP above... this same utf-8 incantation exists in the plain html file with different languages, and that renders just fine on the same computer, same web server, everything. Its just that when put through my perl application, the languages get mangled.

--

when small people start casting long shadows, it is time to go to bed

Replies are listed 'Best First'.
Re^3: accents and diacritical marks in a web page
by Joost (Canon) on Sep 10, 2007 at 11:24 UTC
    Seeing this, and reading your update, it's clear that the perl script itself is UTF-8 encoded. In that case you probably should use the utf8 pragma to indicate that that is the case (basically it just means you don't have to decode() all your string literals).

    AFAIK you can then use HTML::Entities directly, or set STDOUT to :utf8 as I suggested above, or both.

      Hi Joost,

      use utf8; # and even adding... binmode(STDOUT,":utf8");

      doesn't do it. Stuff comes out garbled. It would be nice if it worked, as I wouldn't have use Encode::decode_utf8 on everything, but right now only the latter seems to work.

      If you have any suggestions, let me know. In the meantime I will continue to proceed with Encode and then HTML::Entities

      Many thanks to you and shmem.

      --

      when small people start casting long shadows, it is time to go to bed
        If you use that snippet, you should also make sure the HTML and/or the HTTP headers signal the right encoding (i.e. UTF-8)

        The only thing "use utf8;" does is remove the need to "decode_utf8" on your string literals*. The binmode(STOUD,":utf8"); signals that all output on STDOUT should be utf-8 encoded.

        * i.e. it does nothing to input read from files etc - it only influences literals.