From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!.POSTED!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.help
Subject: Re: Is there a way to "asciify" a string?
Date: Mon, 28 May 2018 10:15:45 +0200
Message-ID:
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: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1527495271 14420 195.159.176.226 (28 May 2018 08:14:31 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 28 May 2018 08:14:31 +0000 (UTC)
Cc: help-gnu-emacs@gnu.org
To: Marcin Borkowski
Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 28 10:14:27 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 1fNDIR-0003g9-5j
for geh-help-gnu-emacs@m.gmane.org; Mon, 28 May 2018 10:14:27 +0200
Original-Received: from localhost ([::1]:54788 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from )
id 1fNDKY-0003t3-40
for geh-help-gnu-emacs@m.gmane.org; Mon, 28 May 2018 04:16:38 -0400
Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46349)
by lists.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1fNDJv-0003su-KJ
for help-gnu-emacs@gnu.org; Mon, 28 May 2018 04:16:01 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1fNDJu-0001RN-EP
for help-gnu-emacs@gnu.org; Mon, 28 May 2018 04:15:59 -0400
Original-Received: from mail-ot0-x22a.google.com ([2607:f8b0:4003:c0f::22a]:40343)
by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
(Exim 4.71) (envelope-from )
id 1fNDJu-0001R9-5r
for help-gnu-emacs@gnu.org; Mon, 28 May 2018 04:15:58 -0400
Original-Received: by mail-ot0-x22a.google.com with SMTP id n1-v6so12619246otf.7
for ; Mon, 28 May 2018 01:15:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=xtgJTLcbPQEBvKa5M9c6w2RY/RJ581aJczrMVvC21jM=;
b=nFnyxIvyNDvURKGpzzgNIOQj3vxFlE94nkybMqOSPvTA3yHd0sJtBwCFXWSTOiM8Ut
UAIlKNReaZlEGDoIwso6N9WA4nQtcfSMWkd+qrTh+fRJ6vPABq5P+DMFRXEBUIPS0pHR
W6ARokKnV8iT6JvKcF8RE7SmvxgRXVrahfS3srtAdPnqzPdqHPAoOK0NGukXjNB9sTS1
/UFbtGQ9DJxMDgsJLWvWFIysB30EYHELHvgFqkQ+oZktET7s1CV2koq7A4heicDzwyBq
XG6o4oLQVzNaAklsb4UNn0uHSoGJn5N9FnxGGhWeMr46x61sk/dwzug8rLyEoe+7xrFz
7zwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=xtgJTLcbPQEBvKa5M9c6w2RY/RJ581aJczrMVvC21jM=;
b=pA6GMFaM+mhY6mxvv0Bzd0I033xUykvnsi/lkjTgqTDE2FL/sYM32ri3RZVhWhtzHy
r+TGWDNEVtaMp/M+SMOizPb+bjyQ7IjPueWHbHdV6NoWDE7FFIbPtgXg/V+EaPCMxgVY
Q2fkaYeF5NyAu/beUKMLPHCpOV6ahZN9F1CjjOfvL2VTDN7CmS766sEs+RHE/FkCK21y
6mnJiPOfnhHPXbNFRBYgv/UcsNRHN75VtWqIgj3De6rDD8boTZQKtbtibwiUtZcSwQaX
lQbozEmB531xlhZh4N5VEs81c3slrVJpaB2gT1rVdaADqsFrR7+j8Nt4YjVsJ/KyYhuZ
Tyig==
X-Gm-Message-State: ALKqPweqlnXnU8jqUu5JJPKcrX028f1x551kg62gqn5DarE3Aum+bNj/
IOmQ9Y/G0cDjTflfMDOnk88i9nlwRfYLFQBdvRIypQ==
X-Google-Smtp-Source: ADUXVKJVQ72dhdjd9Y6SSpMXV1cHqrg2LsoK2n+PPSGPHQiTyuZm+FBZWnmGhGqVhGtdfUYb/BxVmSfPbXa6Qb6qTmI=
X-Received: by 2002:a9d:1811:: with SMTP id
b17-v6mr8300229ote.393.1527495357117;
Mon, 28 May 2018 01:15:57 -0700 (PDT)
In-Reply-To: <87y3g5l1h0.fsf@mbork.pl>
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
recognized.
X-Received-From: 2607:f8b0:4003:c0f::22a
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
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:116878
Archived-At:
Marcin Borkowski schrieb am So., 27. Mai 2018 um 14:38 Uhr=
:
>
> On 2018-05-27, at 09:36, tomas@tuxteam.de wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > On Sun, May 27, 2018 at 08:22:20AM +0200, Marcin Borkowski wrote:
> >> Hi all,
> >>
> >> I want to convert e.g. "=C5=BC=C3=B3=C5=82=C4=87" to "zolc", or "Poinc=
ar=C3=A9" to "Poincare"
> >> etc. IOW, I want to replace all these funny Unicode accented characte=
rs
> >> with their ASCII equivalents.
> >>
> >> Is there anything for that in Emacs?
> >
> > I haven't an answer to your direct question, just a warning: without a
> > language context, you can't do it "correctly". For one illustrative
> > example, in German "=C3=BC" -> "ue", but in Spanish "=C3=BC" -> "u" (th=
ose
> diaereses
> > do have different functions in those languages). Transliterating "=C3=
=BC" with
> > just "u" in German would be wrong (but the reader might make some sense
> > of it), transliterating "=C3=BC" with "ue" in Spanish would not only be=
wrong,
> > but would almost certainly throw off the reader's auto-correction featu=
re
> > (unles (s)he knows German and can recall that association).
> >
> > I'm sure there are tons of other examples like that.
> >
> > Heck, even up- and downcasing is strictly language context dependent
> > (witness the Turkish dotless I).
> >
> > Sigh :-)
>
> I understand that.
>
> 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).
Then why not use only the number, if that's enough the make the filename
unique?
Either the filename is an internal implementation detail, then it doesn't
have to be human-readable.
Or you could ignore portability concerns and use the username as is.