Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: UTF-8 and XML::LibXML

by haj (Vicar)
on Nov 26, 2019 at 13:33 UTC ( [id://11109255]=note: print w/replies, xml ) Need Help??


in reply to Re^4: UTF-8 and XML::LibXML
in thread UTF-8 and XML::LibXML

I can't see from the docs how to get encoded data back

I didn't find a way either, but probably this is intentional because you shouldn't. It is bad practice. As soon as Perl has parsed your document into a tree, it is entitled to forget in whatever encoding it was delivered.

If you want encoded data back, then you get to chose the encoding, and encode by yourself.

I also think that lots of Perl module documentation should be revisited with regard to the ominous "UTF-8 flag". The parenthesis "(UTF-8 encoded with UTF8 flag on)" is at least misleading and should best be eradicated: the relevant thing is "character string", as opposed to "binary" string ("bytes" and "encoded" strings are binary for that purpose). For the user of any module it isn't relevant in which encoding Perl stores character strings internally.

Replies are listed 'Best First'.
Re^6: UTF-8 and XML::LibXML
by davies (Prior) on Nov 26, 2019 at 13:49 UTC

    Thanks. If the intention of the module is to decode data, I can react accordingly. I would also agree that the documentation could be improved, but I do have a tendency to rant about documentation and don't think that it would help solve my problem.

    Regards,

    John Davies

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found