|Do you know where your variables are?|
Re: Can't tell if UTF-8... or just binary...by ikegami (Pope)
|on Aug 23, 2011 at 19:30 UTC||Need Help??|
This makes no sense:
use utf8; utf8_decode("My favorite pokemon is ブラッキー")
«use utf8;» will decode, and then you try to decode again?
Contrary to what you say, @valid does not contain valid UTF-8 strings, since you remove the UTF-8 encoding.
If there are any characters above 255, then it's surely text. Beyond that, it's impossible to determine.
(Irrelevant output removed for brevity and clarity.)
If there are any characters above 127, just try to decode it. If you're successful, it's surely UTF-8.
The chances of getting a false positive are extremely slim. However, if all the characters are below 128, it's impossible to determine.