From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65644 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: [Unicode-2] `read' always returns multibyte symbol Date: Tue, 13 Nov 2007 10:07:17 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1194966490 14973 80.91.229.12 (13 Nov 2007 15:08:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Nov 2007 15:08:10 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org To: Katsumi Yamaoka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 13 16:08:03 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IrxMb-0006Ep-FF for ged-emacs-devel@m.gmane.org; Tue, 13 Nov 2007 16:07:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrxMO-0003BG-UP for ged-emacs-devel@m.gmane.org; Tue, 13 Nov 2007 10:07:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IrxMK-00038Z-NJ for emacs-devel@gnu.org; Tue, 13 Nov 2007 10:07:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IrxMI-000372-9A for emacs-devel@gnu.org; Tue, 13 Nov 2007 10:07:23 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IrxMI-00036t-6F for emacs-devel@gnu.org; Tue, 13 Nov 2007 10:07:22 -0500 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IrxMH-0008Ua-Sj for emacs-devel@gnu.org; Tue, 13 Nov 2007 10:07:21 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 6FD8F2CF6C6; Tue, 13 Nov 2007 10:07:21 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 4CBD23FE0; Tue, 13 Nov 2007 10:07:17 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 37AFD6CAA5; Tue, 13 Nov 2007 10:07:17 -0500 (EST) In-Reply-To: (Katsumi Yamaoka's message of "Tue, 13 Nov 2007 18:41:08 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:83125 gmane.emacs.gnus.general:65644 Archived-At: > --8<---------------cut here---------------start------------->8--- > (let ((string (encode-coding-string "local.=E3=83=86=E3=82=B9=E3=83=88" '= utf-8))) > (with-temp-buffer > (set-buffer-multibyte t) > (insert (string-to-multibyte string)) > (goto-char (point-min)) > (multibyte-string-p (symbol-name (read (current-buffer)))))) > --8<---------------cut here---------------end--------------->8--- I'm not sure what Emacs should do in such a case, but in the example above, using a multibyte buffer is asking for trouble. Can't Gnus use a unibyte buffer in its corresponding code? That would speed things up, save you the use of string-to-multibyte, and make it crystal clear that the result should be unibyte. Stefan "trying hard not to say that the use of a multibyte buffer here is a plain bug ;-)"