From owner-freebsd-questions@FreeBSD.ORG Sat Feb 18 21:14:55 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D32BC16A422 for ; Sat, 18 Feb 2006 21:14:55 +0000 (GMT) (envelope-from gerard@seibercom.net) Received: from smtp5.suscom.net (smtp5.suscom.net [64.78.83.245]) by mx1.FreeBSD.org (Postfix) with ESMTP id 656C343D66 for ; Sat, 18 Feb 2006 21:14:49 +0000 (GMT) (envelope-from gerard@seibercom.net) Received: from localhost (unknown [127.0.0.1]) by smtp5.suscom.net (Postfix) with ESMTP id 4E0255100F5 for ; Sat, 18 Feb 2006 16:14:46 -0500 (EST) Received: from smtp5.suscom.net ([127.0.0.1]) by localhost (smtp5 [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21446-01-75 for ; Sat, 18 Feb 2006 16:14:43 -0500 (EST) Received: from seibercom.net (ip148.217.susc.suscom.net [216.45.217.148]) by smtp5.suscom.net (Postfix) with SMTP id A52075100F4 for ; Sat, 18 Feb 2006 16:14:43 -0500 (EST) Received: from [192.168.0.4] (boss [192.168.0.4]) by seibercom.net (8.13.4/8.13.4) with ESMTP id k1ILEh0b084667 for ; Sat, 18 Feb 2006 16:14:43 -0500 (EST) (envelope-from gerard@seibercom.net) Date: Sat, 18 Feb 2006 16:14:46 -0500 From: Gerard Seibert To: freebsd-questions@freebsd.org Sender: gerard@seibercom.net Organization: Seibercom In-Reply-To: <200602181550.13252.gerard@seibercom.net> References: <1140294574.8388.8.camel@localhost> <200602181550.13252.gerard@seibercom.net> X-Face: "\j?x](l|]4p?-1Bf@!wN<&p=$.}^k-HgL}cJKbQZ3r#Ar]\%U(#6}'?<3s7%(%(gxJxxcR nSNPNr*/^~StawWU9KDJ-CT0k$f#@t2^K&BS_f|?ZV/.7Q Message-Id: <20060218161226.A611.GERARD@seibercom.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Mailer: Becky! ver. 2.24.01 [en] X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on seibercom.net X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new .250 at suscom.net Subject: Re: Removing BOM from UTF-8 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2006 21:14:56 -0000 Gerard Seibert wrote: > enjamin A'Lee wrote: > > > From: > > "Benjamin A'Lee" > > To: > > freebsd-questions@freebsd.org > > Date: > > Today 03:29:34 pm > >   > > > > On Sat, 2006-02-18 at 14:34 -0500, Gerard Seibert wrote: > > > Maybe I am doing something wrong, but it does not appear to be > > > working correctly. I named the file nobom.sh and put it in the same > > > directory as the files I want to convert. I also set the program > > > permission to 0755. > > > > > > typing the p[program name does nothing; I have to precede it with > > > 'perl'. Even then, it does not appear to work correctly. In the > > > following example, the file is parsed, but not converted. > > > > Sorry; try changing the first line to #!/usr/local/bin/perl > > > > > perl nobom.sh testfile > > > > > > Am I doing something incorrectly here? > > > > Try: > > > > cat testfile | nobom.sh > > > > Though the way you describe appears to work here: > > > > $ cat bom-testfile | hd > > 00000000  ef bb bf 23 20 42 4f 4d  20 74 65 73 74 20 66 69  |...# BOM > > test fi| 00000010  6c 65 0a                                         > >  |le.| 00000013 > > $ bomkill.pl bom-testfile | hd > > 00000000  23 20 42 4f 4d 20 74 65  73 74 20 66 69 6c 65 0a  |# BOM > > test file.| 00000010 > > > > > >     Ben > > Something appears to be wrong here. First, the file will not run unless > I precede it with 'perl'. I have another perl script in the same > directory that runs just fine without any special prefixes. Also, the > script does not seem to remove the BOM entity. > > This is the script as I have it entered: > > #!/usr/local/bin/perl > use warnings; > use diagnostics -verbose; > @file=<>; > $file[0] =~ s/^\xEF\xBB\xBF//; > print(@file); > > I have the file permissions set to 0755. Is there anything else that > could be causing this to fail? > > This is the first line of the file I am attempting to fix (well one of > them). > > Subject: > > That is what appears when I use pico to view the file. > As I continue to play with this, it has become apparent that the new file is not being written, or at least I cannot locate it. Since I do not know perl, I have no idea where to look for answers. -- Gerard Seibert gerard@seibercom.net