Correctly handle SHIFT-JIS and ks_c_5601-1987 encodings.