http://www.perlmonks.org?node_id=631116


in reply to Is utf8, ascii ?

From the core utf8 module, you can use:

utf8::valid($string)

But presumably, you don't want to just discard data, Instead, you want to convert it to UTF8 and insert it safely. If you know what character set it is in, then use Encode to convert it. Otherwise, as you have done, you can use Encode::Guess to try to figure out what character set it is first.

Clint