utf-8 detection (kinda sorta)