From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: string-as-unibyte Date: Tue, 19 Jul 2005 08:52:02 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1121730842 9534 80.91.229.6 (18 Jul 2005 23:54:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 18 Jul 2005 23:54:02 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 19 01:53:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1DufQp-000137-00 for ; Tue, 19 Jul 2005 01:53:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DufSm-00016W-C1 for ged-emacs-devel@m.gmane.org; Mon, 18 Jul 2005 19:55:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DufSD-0000xV-No for emacs-devel@gnu.org; Mon, 18 Jul 2005 19:55:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DufS2-0000rw-I9 for emacs-devel@gnu.org; Mon, 18 Jul 2005 19:55:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DufS2-0000r6-Dk for emacs-devel@gnu.org; Mon, 18 Jul 2005 19:55:10 -0400 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DufYK-0000wP-V3 for emacs-devel@gnu.org; Mon, 18 Jul 2005 20:01:41 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 1C56D2CB1; Tue, 19 Jul 2005 08:52:02 +0900 (JST) Original-To: Stefan Monnier In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41055 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41055 >>>>> On Tue, 19 Jul 2005 07:41:33 +0900, YAMAMOTO Mitsuharu said: > I was trying to make a coding system that almost works as utf-8, but > additionally does "HFS+ composition" (canonical composition with > some exclusions) on decoding. > (when str > (erase-buffer) > (insert (if enable-multibyte-characters > (string-as-multibyte str) str))) Maybe this part should have been string-to-multibyte. BTW, I noticed that backslashes in the docstring of string-as-multibyte are stripped off as follows: If you're not sure, whether to use `string-as-multibyte' or `string-to-multibyte', use `string-to-multibyte'. Beware: (aref (string-as-multibyte "201") 0) -> 129 (aka ?201) (aref (string-as-multibyte "300") 0) -> 192 (aka ?300) (aref (string-as-multibyte "300201") 0) -> 192 (aka ?300) (aref (string-as-multibyte "300201") 1) -> 129 (aka ?201) but (aref (string-as-multibyte "201300") 0) -> 2240 (aref (string-as-multibyte "201300") 1) -> YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp