[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to "asciify" a string?
From: |
Philipp Stephani |
Subject: |
Re: Is there a way to "asciify" a string? |
Date: |
Mon, 28 May 2018 10:15:45 +0200 |
Marcin Borkowski <mbork@mbork.pl> 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. "żółć" to "zolc", or "Poincaré" to "Poincare"
> >> etc. IOW, I want to replace all these funny Unicode accented characters
> >> 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 "ü" -> "ue", but in Spanish "ü" -> "u" (those
> diaereses
> > do have different functions in those languages). Transliterating "ü" with
> > just "u" in German would be wrong (but the reader might make some sense
> > of it), transliterating "ü" with "ue" in Spanish would not only be wrong,
> > but would almost certainly throw off the reader's auto-correction feature
> > (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.
- Re: Is there a way to "asciify" a string?, (continued)
- Re: Is there a way to "asciify" a string?, Yuri Khan, 2018/05/27
- Re: Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/30
- Re: Is there a way to "asciify" a string?, Yuri Khan, 2018/05/30
- Re: Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/30
- Re: Is there a way to "asciify" a string?, John Mastro, 2018/05/30
- Re: Is there a way to "asciify" a string?, tomas, 2018/05/27
- Re: Is there a way to "asciify" a string?,
Philipp Stephani <=
- Re: Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/28
- Re: Is there a way to "asciify" a string?, tomas, 2018/05/28
- Re: Is there a way to "asciify" a string?, Yuri Khan, 2018/05/28
- Re: Is there a way to "asciify" a string?, tomas, 2018/05/28
- Re: Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/30
- Re: Is there a way to "asciify" a string?, Stefan Monnier, 2018/05/31
- Re: Is there a way to "asciify" a string?, S. Champailler, 2018/05/31
- Re: Is there a way to "asciify" a string?, Richard Wordingham, 2018/05/31
- Re: Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/31
- Re: Is there a way to "asciify" a string?, Eli Zaretskii, 2018/05/31