From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: bulk replacement on region, buffer, file? Date: Thu, 10 Dec 2015 09:40:37 -0700 Message-ID: <20151210093628551131702@bob.proulx.com> References: <87vb87t55n.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1449765671 4303 80.91.229.3 (10 Dec 2015 16:41:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Dec 2015 16:41:11 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 10 17:41:03 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a74H8-0007hk-Uo for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Dec 2015 17:41:03 +0100 Original-Received: from localhost ([::1]:42864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a74H7-0006QS-Q6 for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Dec 2015 11:41:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a74Gq-0006Pz-RY for help-gnu-emacs@gnu.org; Thu, 10 Dec 2015 11:40:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a74Gk-0002Jc-OM for help-gnu-emacs@gnu.org; Thu, 10 Dec 2015 11:40:44 -0500 Original-Received: from havoc.proulx.com ([96.88.95.61]:57905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a74Gk-0002JQ-BG for help-gnu-emacs@gnu.org; Thu, 10 Dec 2015 11:40:38 -0500 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 9F5F519EC for ; Thu, 10 Dec 2015 09:40:37 -0700 (MST) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 4BDFB2183B for ; Thu, 10 Dec 2015 09:40:37 -0700 (MST) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 226562DBC1; Thu, 10 Dec 2015 09:40:37 -0700 (MST) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87vb87t55n.fsf@pobox.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108353 Archived-At: Tom Roche wrote: > I would appreciate pointers to code that enables "bulk replacement" > of numerous string tuples ({to-replace, replace-with}) in a single > call. What I mean, why I ask: To handle the UTF-8 translations I like 'iconv'. It handles many different types of transliterations. $ echo '=E2=80=9Cfoo=E2=80=9D' | iconv -f UTF-8 -t ASCII//TRANSLIT "foo" If it were me I would do a first pass using iconv to transliterate characters in the first pass and then perform the other replacements you want in a second pass. Bob