http://www.perlmonks.org?node_id=958798


in reply to Encode only wide char entities?

Why would someone escape more than &<>'" these days? Isn't your HTML's charset UTF-8?

Replies are listed 'Best First'.
Re^2: Encode only wide char entities?
by jabowery (Beadle) on Mar 09, 2012 at 22:46 UTC
    I'm using utf8 but I'm getting "wide chars" from nasty M$ programs.

    What I was missing was the unicode range syntax:

    encode_entities($_,'\x{0100}-\x{FFFF}')

    I suppose I could convert everything to utf8 that comes in but I wanted to expose the unicode as entities in the source.

      You SAY you're using UTF-8, but you forgot to actually encode to UTF-8. You probably need something like
      binmode(STDOUT, ":encoding(UTF-8)");
Re^2: Encode only wide char entities?
by LanX (Bishop) on Mar 09, 2012 at 22:55 UTC
    some webadmins configure apache to deliver iso-latin and deny .htaccess.

    no chance to use utf8 then.

    I had this case just a week ago...

    Cheers Rolf

      And Perlmonks uses cp1252. I'm assuming that's not the case here until he tells me otherwise.