Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^5: UTF8 Output with XML::Feed? (updated)

by pryrt (Abbot)
on Mar 07, 2022 at 20:28 UTC ( [id://11141896]=note: print w/replies, xml ) Need Help??


in reply to Re^4: UTF8 Output with XML::Feed? (updated)
in thread UTF8 Output with XML::Feed?

erm ... едц???

I had the same thought on my first reading of that post, and even send a /msg to that effect.

But then I reread kcott's post, and saw that the second block of code from the earlier post was the code kcott focused on, and was presumably the code that kcott said didn't need use utf8; -- which seems right, because it doesn't contain non-ASCII characters.

Replies are listed 'Best First'.
Re^6: UTF8 Output with XML::Feed? (updated)
by LanX (Saint) on Mar 07, 2022 at 20:46 UTC
    yes I realized it in the meantime.

    I didn't expect it but \N{} is automatically activating the utf8 flag for the surrounding string. (which makes sense in hindsight)

    use v5.12; use warnings; use Devel::Peek; #use open OUT => qw{:encoding(UTF-8) :std}; my $t4 = "\N{LATIN SMALL LETTER A WITH RING ABOVE}\n"; Dump $t4; warn "t4: ",$t4; __DATA__
    OUTPUT:
    SV = PV(0xe7ae08) at 0xd308f0 REFCNT = 1 FLAGS = (POK,IsCOW,pPOK,UTF8) PV = 0x2742188 "\303\245\n"\0 [UTF8 "\x{e5}\n"] CUR = 3 LEN = 10 COW_REFCNT = 1 t4: е

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141896]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found