From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Is there a way to "asciify" a string? Date: Wed, 30 May 2018 20:05:06 +0300 Message-ID: <83wovlgjlp.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1527699824 11181 195.159.176.226 (30 May 2018 17:03:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 May 2018 17:03:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 30 19:03:40 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 1fO4Vc-0002lg-F2 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2018 19:03:36 +0200 Original-Received: from localhost ([::1]:39834 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO4Xj-0005FX-IR for geh-help-gnu-emacs@m.gmane.org; Wed, 30 May 2018 13:05:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO4XC-0005Eo-Gu for help-gnu-emacs@gnu.org; Wed, 30 May 2018 13:05:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fO4X9-0003KD-B5 for help-gnu-emacs@gnu.org; Wed, 30 May 2018 13:05:14 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fO4X9-0003K0-7C for help-gnu-emacs@gnu.org; Wed, 30 May 2018 13:05:11 -0400 Original-Received: from [176.228.60.248] (port=1265 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fO4X8-00035Y-7Z for help-gnu-emacs@gnu.org; Wed, 30 May 2018 13:05:10 -0400 In-reply-to: <878t81cv0d.fsf@mbork.pl> (message from Marcin Borkowski on Wed, 30 May 2018 12:12:18 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:116910 Archived-At: > From: Marcin Borkowski > Cc: Eli Zaretskii , help-gnu-emacs > Date: Wed, 30 May 2018 12:12:18 +0200 > > > (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 "żółć") gived "zoc" and not > "zolc"... That's because ł doesn't have any decompositions. So it stays unchanged and is removed because its codepoint is above 127.