Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: How to avoid decoding string to utf-8.

by choroba (Cardinal)
on Oct 09, 2020 at 19:04 UTC ( [id://11122641]=note: print w/replies, xml ) Need Help??


in reply to How to avoid decoding string to utf-8.

A string needs decoding from UTF-8 if it's encoded in UTF-8 and you want to access its unicode characters rather than octets (bytes).

Without seeing the strings and the code ("this one works" -- what does it mean?), we can only guess what you're trying to solve. The problem has no general solution, as an input that's valid UTF-8 might also have meaning without decoding (for example, the bytes c3 83 c2 a5 correspond either to four bytes, or two characters Ã¥, which is an unusual combination usually coming from a double encoded letter å - but what it really is depends on what you want to do with it).

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found