help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a way to "asciify" a string?


From: Teemu Likonen
Subject: Re: Is there a way to "asciify" a string?
Date: Sun, 27 May 2018 19:59:23 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Eli Zaretskii [2018-05-27 19:07:40+03] wrote:

> 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.?

Emacs has loads of stuff that I don't know or don't have time to study.
:-) But thanks for your ucs-normalize hint. An ASCII normalization and
filter could be something like this:


    (defun my-ascii-normalize-filter (string)
      (require 'cl-lib)
      (cl-remove-if (lambda (char)
                      (> char 127))
                    (ucs-normalize-NFKD-string string)))

Maybe one could want to filter out control chars too...

-- 
/// Teemu Likonen   - .-..   <https://keybase.io/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]