From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.devel Subject: Re: How to use string-to/as-unibyte correctly? Date: Wed, 22 Jun 2016 11:33:19 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1466566472 20672 80.91.229.3 (22 Jun 2016 03:34:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jun 2016 03:34:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 22 05:34:17 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bFYvh-0002P3-4a for ged-emacs-devel@m.gmane.org; Wed, 22 Jun 2016 05:34:17 +0200 Original-Received: from localhost ([::1]:55442 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFYvg-0000hN-6z for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2016 23:34:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39547) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFYv6-0000h6-6f for emacs-devel@gnu.org; Tue, 21 Jun 2016 23:33:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFYv2-0003Cx-5W for emacs-devel@gnu.org; Tue, 21 Jun 2016 23:33:39 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:45268) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFYv1-0003CJ-Um for emacs-devel@gnu.org; Tue, 21 Jun 2016 23:33:36 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1bFYuz-0001Z1-4w for emacs-devel@gnu.org; Wed, 22 Jun 2016 05:33:33 +0200 Original-Received: from 116.213.171.151 ([116.213.171.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Jun 2016 05:33:33 +0200 Original-Received: from sdl.web by 116.213.171.151 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Jun 2016 05:33:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 116.213.171.151 Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAAG1BMVEUAAAA9Cgm3Hx1WWFWA gn+WmJWsrqv4+vcCAwCRl2MkAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAAAYoA AAGKATOXMFgAAAAHdElNRQfXAQwDNR+ZJmElAAABIklEQVQoz22SPW+DQAyGWUq65qasd9PNUSX4 AZHK2C1rJy5jpDS4IwRVup9dn7GNafpKIPPgzztXFSujqq1eM2n8h22oMkvxI/i9C97kRfMRUN55 dS3BrsAwBXUtMLAO4lryh8kTjOxKpQNniNxAgZOEe4bZwsDTFhKdqZRLNII4OQNHhEuq/RMkm6Cj TnnEA/fk0BorcYn5qA3oaeAxbaBOLrX+9G48NZ2Fzc2tzDM8Q+tMypEOqYHh8mAWaaK3U/cDMOT5 aMZMABgPXc7zPMs1A8DXO756GFJ/4fMEq47hTsAdn5avoxZ4ywl0c2w4Flu2Ybeyb3S+EqxX2DYA H8veJGEDTnHnrXvRaPyt+2kSfK6rfBZ2tUtfP/mR+pR6sX8BUZ/cDV7tvkoAAAAASUVORK5CYII= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (OS X 10.11.5) Cancel-Lock: sha1:vgVmECwghkPVK5EevMs1NQMICwA= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204661 Archived-At: On 2016-06-20 20:56 -0400, Stefan Monnier wrote: [snipped 4 lines] > The correct way to use them is to not use them and use > encode/decode-coding-string instead. > > > Stefan On 2016-06-21 05:36 +0300, Eli Zaretskii wrote: [snipped 7 lines] > Don't use them, period. They are remnants from the era long gone, > before Emacs used Unicode and UTF-8 as the basis for its internal > representation of characters. Nowadays the only place where such > conversions are sometimes needed are on the C level, deep within Emacs > internals. Applications should never use them. > > I'm okay with declaring them obsolete, if it helps. I had two cases of string-to-unibyte to mean I am expecting unibyte string and will complain if given something else. Looks like we'd better start the process of phasing out these functions so that nobody will make the mistake of using them. Leo