fix text encoding, reverse to/from codeset