in reply to Problem with œ / Œ ligature encoding

Try adding use Unicode::CharName 'uname'; and warn uname ord $1 while /(.)/g; to your while loop. Thus you'll be able to know how exactly Perl decodes your text and whether the error happens at the decoding or the encoding phase.