Re: Removing BOM from UTF-8
- From: Benjamin A'Lee <lists@xxxxxxxxxxxxx>
- Date: Sat, 18 Feb 2006 17:24:30 +0000
On Sat, 2006-02-18 at 11:28 -0500, Gerard Seibert wrote:
It has been suggested that a script could be written to eliminate the
BOM from a file(s). My script writing skills suck. I have been unable to
locate one using Google, so I was hoping that someone might know where I
could either locate such a program, or perhaps give me an idea on how to
script one.
#!/usr/bin/perl
@file=<>;
$file[0] =~ s/^\xEF\xBB\xBF//;
print(@file);
That'll read a file from stdin, remove the BOM from the beginning of the
first line if it's present, and print it to stdout.
Hope it helps.
Ben
--
Termisoc Tech Officer: <http://termisoc.org/>
My Homepage: <http://benalee.co.uk/>
"People demand freedom of speech as compensation for the freedom of
thought which they have but seldom use." -- Søren Kierkegaard
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: Removing BOM from UTF-8
- From: Gerard Seibert
- Re: Removing BOM from UTF-8
- References:
- Removing BOM from UTF-8
- From: Gerard Seibert
- Removing BOM from UTF-8
- Prev by Date: RE: Odd file created in /
- Next by Date: Re: DVD Burner
- Previous by thread: Removing BOM from UTF-8
- Next by thread: Re: Removing BOM from UTF-8
- Index(es):