From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.help Subject: Re: Is there a way to "asciify" a string? Date: Sun, 27 May 2018 15:52:58 +0300 Message-ID: <871sdxgt05.fsf@iki.fi> References: <87zi0llisj.fsf@mbork.pl> <20180527073645.GB17354@tuxteam.de> <87y3g5l1h0.fsf@mbork.pl> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Trace: blaine.gmane.org 1527425502 21946 195.159.176.226 (27 May 2018 12:51:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 27 May 2018 12:51:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: help-gnu-emacs To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 27 14:51:37 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fMv97-0005cj-NE for geh-help-gnu-emacs@m.gmane.org; Sun, 27 May 2018 14:51:37 +0200 Original-Received: from localhost ([::1]:52020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMvBE-0003sy-R7 for geh-help-gnu-emacs@m.gmane.org; Sun, 27 May 2018 08:53:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMvAb-0003rt-Kv for help-gnu-emacs@gnu.org; Sun, 27 May 2018 08:53:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMvAY-0005ff-Il for help-gnu-emacs@gnu.org; Sun, 27 May 2018 08:53:09 -0400 Original-Received: from mail.kapsi.fi ([2001:67c:1be8::25]:46265) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMvAY-0005cQ-77 for help-gnu-emacs@gnu.org; Sun, 27 May 2018 08:53:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=xfl8G3faZmGkjc4lrZGXThFmZ84YYXLy+uE6Xd49tMA=; b=A+IRlIcryXyghA2z8r9iR5+0V5qDfNR2KKIyo75wZQ+lGeP96Tgf9A5X6TQgNcybo59kXz6LaWVbEw8BYwrX9scJpaAHg+Mf/F4izyO0m7nGnZCEIseX+VtuozzmvF8bE45tskia8r7G5f4rRlpFdgc4anSiTM97D6seCeBis0KGGt/ghA+3lvJYZkZx8ebalUKxEIDntQc6t8e/d5dqgffWr2EkCdVjnglXPmCkYz+x0qCYeDFctxC8HEWix33IyJs0h0lrqG2rcM07Pwvd6w8sz8mAG5Uwh8ho4+hdxJIfnQMBrHtE5S+y1zcpm0+cbP4OsYeGb73JKUrfi+XeKQ==; Original-Received: from mobile-access-6df041-159.dhcp.inet.fi ([109.240.65.159] helo=mithlond) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fMvAT-0000DE-QC; Sun, 27 May 2018 15:53:01 +0300 In-Reply-To: <87y3g5l1h0.fsf@mbork.pl> (Marcin Borkowski's message of "Sun, 27 May 2018 14:36:27 +0200") X-SA-Exim-Connect-IP: 109.240.65.159 X-SA-Exim-Mail-From: tlikonen@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:67c:1be8::25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:116868 Archived-At: --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Marcin Borkowski [2018-05-27 14:36:27+02] wrote: > Still, I need something *simple*. I have a person's name (possibly > with some national characters), and I want to derive a filename from > it. It doesn't have to be correct in 100% cases. It doesn't even have > to be unambiguous (there will be a number for that in the filename, > too). > (BTW, if there is some command-line utility to do that, that's fine > too.) There is iconv: $ echo =E1=E0=E3=E4 | iconv -t ASCII//TRANSLIT aaaa So an Emacs Lisp wrapper function for iconv can be written like this: (defun my-iconv-ascii-translit (string) (with-temp-buffer (insert string) (call-process-region (point-min) (point-max) "iconv" t t nil "-t" "ASCII//TRANSLIT") (buffer-substring-no-properties (point-min) (point-max)))) =2D-=20 /// Teemu Likonen - .-.. // // PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 /// --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEkhZiiC54Bnj5a16Skzo1BB5+rVEFAlsKqioACgkQkzo1BB5+ rVHtPwf/W4+aBG5egEWw2I5+FhF13aFjD4WzLGVZFpdUU9vPAjEsjIMuk7O/mwik jQFfeT0PWYXcmMFlHpyc/eNymeGBuyUUj67U60IijNrnO30B1A6CWZUB9Vcrb6XC GZxXIZiro2DB7if40QD7RpcOrqMmk2cKG1/s/JS08ctZxA77rG3SkiodWK+0dh4/ n+PZHGi+/GWMexR8OReqV6r3IHcsTzMvY8zYxh+LX6yJD+5APs1LEW2IojKNMasy S74wLllbFbbNqSE4U/RieUyR/DuLInfX6sLP7tuLv2zYFc8CddXb9OunuqlrgTdk EvcQg0RfWMg3Lu4/GKrNjXE1WMU+2A== =9s1O -----END PGP SIGNATURE----- --=-=-=--