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 21:38:33 +0200 Message-ID: <871sdtdjd2.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> <878t81cv0d.fsf@mbork.pl> <83wovlgjlp.fsf@gnu.org> 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 1527709274 16895 195.159.176.226 (30 May 2018 19:41:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 19:41:14 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 30 21:41:10 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 1fO6y5-0004GT-9b for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2018 21:41:09 +0200 Original-Received: from localhost ([::1]:40481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO70A-0000nU-QS for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2018 15:43:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO6wi-0007PO-1s for help-gnu-emacs@gnu.org; Wed, 30 May 2018 15:39:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fO6wh-0005cX-58 for help-gnu-emacs@gnu.org; Wed, 30 May 2018 15:39:44 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:54301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO6wd-0005aA-DW; Wed, 30 May 2018 15:39:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 74613E6F18; Wed, 30 May 2018 21:39:38 +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 E_o7g1emubhV; Wed, 30 May 2018 21:39:35 +0200 (CEST) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id 51234E6F17; Wed, 30 May 2018 21:39:35 +0200 (CEST) In-reply-to: <83wovlgjlp.fsf@gnu.org> 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:116917 Archived-At: On 2018-05-30, at 19:05, Eli Zaretskii wrote: >> From: Marcin Borkowski >> Cc: Eli Zaretskii , help-gnu-emacs >> Date: Wed, 30 May 2018 12:12:18 +0200 >>=20 >> > (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... >>=20 >> Thanks, that's a step in the right direction! >>=20 >> However, (my-ascii-normalize-filter "=C5=BC=C3=B3=C5=82=C4=87") gived "z= oc" and not >> "zolc"... > > That's because =C5=82 doesn't have any decompositions. So it stays > unchanged and is removed because its codepoint is above 127. I see. This means that I'll have to take care of it on an earlier stage. Not very elegant - but what could I expect with Unicode? ;-) Thanks, --=20 Marcin Borkowski http://mbork.pl