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]