use open IN => ':encoding(utf-16)', OUT => ':encoding(us-ascii)'; print while <>;