From owner-freebsd-questions@FreeBSD.ORG Tue Dec 12 20:50:12 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E362716A57F for ; Tue, 12 Dec 2006 20:50:12 +0000 (UTC) (envelope-from prvs=johnl=0494a64d7d@iecc.com) Received: from xuxa.iecc.com (xuxa.iecc.com [208.31.42.42]) by mx1.FreeBSD.org (Postfix) with SMTP id 3C61E43CB2 for ; Tue, 12 Dec 2006 20:48:42 +0000 (GMT) (envelope-from prvs=johnl=0494a64d7d@iecc.com) Received: (qmail 8593 invoked from network); 12 Dec 2006 20:50:04 -0000 Received: from simone.iecc.com (208.31.42.47) by mail2.iecc.com with QMQP; 12 Dec 2006 20:50:04 -0000 Date: 12 Dec 2006 20:50:04 -0000 Message-ID: <20061212205004.35548.qmail@simone.iecc.com> From: John Levine To: freebsd-questions@freebsd.org In-Reply-To: <20061212063808.GA31424@thought.org> Organization: Mime-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Cc: kline@tao.thought.org Subject: Re: can I use perl substitution to handle hex chars? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 20:50:13 -0000 > Seems like lots of files I get off the net use \x80\x98 or the > like to denote various non-ascii characters. Is there a way to > use perl (or any other unix tool) to replace > \x\x with, say whatever ASCII or ISO-8859-1 > character or characters? perl -pe 's/\\x(\w\w)/chr(hex("$1"))/eg' R's, John