- From: Martin Duerst <duerst@w3.org>
- Date: Wed, 05 Nov 2003 08:37:42 -0500
- To: "Deborah Cawkwell" <deborah.cawkwell@bbc.co.uk>, <public-i18n-geo@w3.org>
Deborah - here is the perl code that removes the bom:
This is the version by Jonathan Coxhead, given on the Unicode
list:
#!/usr/bin/perl -pi~ -0777
# program to remove a leading UTF-8 BOM from a file
# works both STDIN -> STDOUT and on the spot (with filename as argument)
s/^\xEF\xBB\xBF//s;
It can even be typed directly, as:
prompt> perl -pi~ -0777 -e "s/^\xEF\xBB\xBF//s;" filewithbom.html
This uses some very convenient options of perl.
Regards, Martin.
Received on Wednesday, 5 November 2003 08:40:30 UTC