From owner-freebsd-questions@FreeBSD.ORG Sat Feb 18 20:50:18 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 BA84D16A420 for ; Sat, 18 Feb 2006 20:50:18 +0000 (GMT) (envelope-from gerard@seibercom.net) Received: from smtp1.suscom.net (smtp1.suscom.net [64.78.119.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4FBD043D49 for ; Sat, 18 Feb 2006 20:50:17 +0000 (GMT) (envelope-from gerard@seibercom.net) Received: from localhost (smtp1 [127.0.0.1]) by smtp1.suscom.net (Postfix) with ESMTP id 55D691D0004 for ; Sat, 18 Feb 2006 15:53:09 -0500 (EST) Received: from smtp1.suscom.net ([127.0.0.1]) by localhost (smtp1 [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 24772-01 for ; Sat, 18 Feb 2006 15:53:08 -0500 (EST) Received: from seibercom.net (ip148.217.susc.suscom.net [216.45.217.148]) by smtp1.suscom.net (Postfix) with SMTP id 6F7991D0002 for ; Sat, 18 Feb 2006 15:53:08 -0500 (EST) Received: from seibercom.net (localhost [127.0.0.1]) by seibercom.net (8.13.4/8.13.4) with ESMTP id k1IKoEE8084498 for ; Sat, 18 Feb 2006 15:50:14 -0500 (EST) (envelope-from gerard@seibercom.net) Received: from localhost (localhost [[UNIX: localhost]]) by seibercom.net (8.13.4/8.13.4/Submit) id k1IKoDYR084497 for freebsd-questions@freebsd.org; Sat, 18 Feb 2006 15:50:13 -0500 (EST) (envelope-from gerard@seibercom.net) From: Gerard Seibert Organization: Seibercom,net To: freebsd-questions@freebsd.org Date: Sat, 18 Feb 2006 15:50:04 -0500 User-Agent: KMail/1.9.1 References: <20060218111849.15E6.GERARD@seibercom.net> <200602181435.07066.gerard@seibercom.net> <1140294574.8388.8.camel@localhost> In-Reply-To: <1140294574.8388.8.camel@localhost> X-Face: "\j?x](l|]4p?-1Bf@!wN<&p=$.}^k-HgL}cJKbQZ3r#Ar]\%U(#6}'?<3s7%(%(=?utf-8?q?gxJxxc=0A=09RnSNPNr*/=5E=7EStawWU9KDJ-CT0k=24f=23?=@t2^K&BS_f|?ZV/.7Q MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7635913.jlODiEy3dC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200602181550.13252.gerard@seibercom.net> 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 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: gerard@seibercom.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Feb 2006 20:50:18 -0000 --nextPart7635913.jlODiEy3dC Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline enjamin A'Lee wrote: > From: > "Benjamin A'Lee" > To: > freebsd-questions@freebsd.org > Date: > Today 03:29:34 pm > =C2=A0 > > 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 =C2=A0ef bb bf 23 20 42 4f 4d =C2=A020 74 65 73 74 20 66 69 =C2= =A0|...# BOM > test fi| 00000010 =C2=A06c 65 0a =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0|le.| 00000013 > $ bomkill.pl bom-testfile | hd > 00000000 =C2=A023 20 42 4f 4d 20 74 65 =C2=A073 74 20 66 69 6c 65 0a =C2= =A0|# BOM > test file.| 00000010 > > > =C2=A0 =C2=A0 Ben Something appears to be wrong here. First, the file will not run unless=20 I precede it with 'perl'. I have another perl script in the same=20 directory that runs just fine without any special prefixes. Also, the=20 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=3D<>; $file[0] =3D~ s/^\xEF\xBB\xBF//; print(@file); I have the file permissions set to 0755. Is there anything else that=20 could be causing this to fail? This is the first line of the file I am attempting to fix (well one of=20 them). =C3=AF=C2=BB=C2=BFSubject: That is what appears when I use pico to view the file. =2D-=20 Gerard Seibert gerard@seibercom.net PGP: http://www.seibercom.net/sig/gerard.asc --nextPart7635913.jlODiEy3dC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQBD94iFchM2dIO+3uMRAhyaAKCQbknYMo5eckbi4U/8kvTS/dAg1QCfe96i tLot4w2vyF53LChQhJVg/Yw= =Wz3m -----END PGP SIGNATURE----- --nextPart7635913.jlODiEy3dC--