|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Distinguish between HTML and Plain textby ikegami (Pope) |
| on Sep 26, 2011 at 23:11 UTC ( #927973=note: print w/ replies, xml ) | Need Help?? |
|
Impossible. At best, you can take a guess. But you can guess very reliably because HTML must have an HTML element. If you don't know if it's text or HTML, then you're surely dealing with bytes, so you need to handle UTF-16le, UTF-16be, UCS-2le, UCS-2be, UCS-4le, UCS-4be:
If you're somehow dealing with decoded text:
Update: No, that's still not good enough. A text version of this very post would fail, for example.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||