Use String#encoding instead of GLib.locale_from_utf8