in reply to Remove ÿþ from a string

Since the BOM is unicode, you have to use unicode to remove the BOM:

s/\x{feff}//;

But if you use vim, removing the BOM is as simple as loading the file, typing

:set nobomb

and writing the file back to disk.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'