[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there a way to "asciify" a string?
From: |
Eli Zaretskii |
Subject: |
Re: Is there a way to "asciify" a string? |
Date: |
Sun, 27 May 2018 19:07:40 +0300 |
> From: Teemu Likonen <tlikonen@iki.fi>
> Date: Sun, 27 May 2018 15:52:58 +0300
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>
> > (BTW, if there is some command-line utility to do that, that's fine
> > too.)
>
> There is iconv:
>
> $ echo áàãä | 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))))
Come on, crowd, you _must_ know that Emacs has all of the iconv's
functionality (and more) built-in, right? All that encode-coding
stuff etc.?
Btw, ASCII//TRANSLIT doesn't necessarily guarantee it will succeed in
removing all the diacritics, AFAIK. You need to completely decompose
the characters for that, and AFAIK iconv doesn't have such
capabilities. (Emacs does.)
- Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/27
- Re: Is there a way to "asciify" a string?, tomas, 2018/05/27
- Re: Is there a way to "asciify" a string?, Marcin Borkowski, 2018/05/27
- Re: Is there a way to "asciify" a string?, Teemu Likonen, 2018/05/27
- Re: Is there a way to "asciify" a string?,
Eli Zaretskii <=
- Re: Is there a way to "asciify" a string?, Teemu Likonen, 2018/05/27
- Re: Is there a way to "asciify" a string?, Tak Kunihiro, 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?, Eli Zaretskii, 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?, tomas, 2018/05/27
- Re: Is there a way to "asciify" a string?, Eli Zaretskii, 2018/05/28
- Re: Is there a way to "asciify" a string?, tomas, 2018/05/29
- 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