Hi

I dont understand the problem, why are you looking at the utf flag?

It appears to be something to do with use utf8;

No UTF8 flag for \xE9, not before nor after

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd /; use Devel::Peek qw/ Dump /; my %f = ( qq{cl\xE9}, qq{cl\xE9} ); Dump($_)for keys%f; $f{qq{cl\xE9}}=qq{cl\xE9}; $f{qq{\x{2665} \N{U+1F42A}}}=qq{\x{2665} \N{U+1F42A}}; dd\%f; dd(keys %f); Dump($_)for keys%f; __END__ SV = PV(0x3f7a8c) at 0x3f9b74 REFCNT = 2 FLAGS = (POK,FAKE,READONLY,pPOK) PV = 0x9a8ad0 "cl\351" CUR = 3 LEN = 0 { "cl\xE9" => "cl\xE9", "\x{2665} \x{1F42A}" => "\x{2665} \x{1F42A}" } ("\x{2665} \x{1F42A}", "cl\xE9") SV = PV(0xb98cc4) at 0x3f9b84 REFCNT = 2 FLAGS = (POK,FAKE,READONLY,pPOK,UTF8) PV = 0xa78390 "\342\231\245 \360\237\220\252" [UTF8 "\x{2665} \x{1f4 +2a}"] CUR = 8 LEN = 0 SV = PV(0x3f7ac4) at 0x99b9c4 REFCNT = 2 FLAGS = (POK,FAKE,READONLY,pPOK) PV = 0x9a8ad0 "cl\351" CUR = 3 LEN = 0

But utf8.pm doesn't like it

$ perl -le "use Data::Dump; use utf8; dd qq{é}" Malformed UTF-8 character (1 byte, need 3, after start byte 0xe9) at - +e line 1. "\0" $ perl -le "use Data::Dump; dd qq{é}" "\xE9"

In reply to Re: UTF8 hash key downgraded when assigned ( use utf8; ) by beech
in thread UTF8 hash key downgraded when assigned by gibus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.