protected function getCurrentEncoding() { $locale = explode('.', setlocale(LC_CTYPE, 0)); return isset($locale[1]) ? $locale[1] : 'UTF8'; }