From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Is there a way to "asciify" a string? Date: Wed, 30 May 2018 12:12:18 +0200 Message-ID: <878t81cv0d.fsf@mbork.pl> References: <87zi0llisj.fsf@mbork.pl> <20180527073645.GB17354@tuxteam.de> <87y3g5l1h0.fsf@mbork.pl> <871sdxgt05.fsf@iki.fi> <83d0xh84kz.fsf@gnu.org> <87sh6df310.fsf@iki.fi> 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 1527675217 1173 195.159.176.226 (30 May 2018 10:13:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 10:13:37 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: help-gnu-emacs To: Teemu Likonen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 30 12:13:33 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 1fNy6m-0000Cf-GO for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2018 12:13:32 +0200 Original-Received: from localhost ([::1]:37401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNy8t-0001BL-Kn for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2018 06:15:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNy6v-0000By-Bx for help-gnu-emacs@gnu.org; Wed, 30 May 2018 06:13:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNy6u-0000a7-Ga for help-gnu-emacs@gnu.org; Wed, 30 May 2018 06:13:41 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:39817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNy6o-0000Vo-QJ; Wed, 30 May 2018 06:13:34 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id A0104E6D84; Wed, 30 May 2018 12:13:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2_k9qATtBN0w; Wed, 30 May 2018 12:13:25 +0200 (CEST) Original-Received: from localhost (188.47.47.7.ipv4.supernova.orange.pl [188.47.47.7]) by mail.mojserwer.eu (Postfix) with ESMTPSA id D162BE68AF; Wed, 30 May 2018 12:13:24 +0200 (CEST) In-reply-to: <87sh6df310.fsf@iki.fi> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.110.48.8 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:116901 Archived-At: On 2018-05-27, at 18:59, Teemu Likonen wrote: > 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... Thanks, that's a step in the right direction! However, (my-ascii-normalize-filter "=C5=BC=C3=B3=C5=82=C4=87") gived "zoc"= and not "zolc"... Best, --=20 Marcin Borkowski http://mbork.pl