Gnus development mailing list
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Katsumi Yamaoka <yamaoka@jpl.org>
Cc: Kenichi Handa <handa@ni.aist.go.jp>, ding@gnus.org, emacs-devel@gnu.org
Subject: Re: [Unicode-2] `read' always returns multibyte symbol
Date: Wed, 14 Nov 2007 22:39:35 -0500	[thread overview]
Message-ID: <jwvsl38ji8y.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <b4mve84dxfz.fsf@jpl.org> (Katsumi Yamaoka's message of "Thu, 15 Nov 2007 12:01:04 +0900")

> I think it's better, too.  However, there might be a code that
> copies data from nntp-server-buffer to a multibyte buffer.  I'm
> not capable to check all the Gnus code.

I understand the desire to avoid changing code, but I think in the long
run it'll pay off.

>>> (IIUC, copying data from a multibyte buffer to a unibyte buffer
>>> causes no problem).

>> I'm not sure I understand: copying data from a multibyte buffer to
>> a unibyte buffer is exactly the case that can cause problems.

> I agree that's generally true.  But in Gnus' case, data in a
> multibyte work buffer are the multibyte version of binary data.
> I don't know proper words to explain it, sorry.  In other words,
> they are the one which `string-to-multibyte' converted binary
> data to.  For example:

> (with-temp-buffer
>   (set-buffer-multibyte t)
>   (insert (string-to-multibyte (encode-coding-string "日本語" 'utf-8)))
>   (let ((buffer (current-buffer)))
>     (with-temp-buffer
>       (set-buffer-multibyte nil)
>       (insert-buffer-substring buffer)
>       (decode-coding-string (buffer-string) 'utf-8))))
>  => "日本語"

> I'm not sure it works with any data, though.

I'm not sure what you're saying.  But IIUC the source buffer in your
example would be nntp-server-buffer, in which case turning it into
unibyte will not introduce any problem.  On the contrary, it'll make it
more obviously correct.


        Stefan

  reply	other threads:[~2007-11-15  3:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-13  9:41 Katsumi Yamaoka
2007-11-13 12:55 ` Kenichi Handa
2007-11-13 15:10   ` Stefan Monnier
2007-11-14  4:53     ` Kenichi Handa
2007-11-14  3:56   ` Katsumi Yamaoka
2007-11-14 11:39     ` Katsumi Yamaoka
2007-11-14 14:52       ` Stefan Monnier
2007-11-14 23:52         ` Katsumi Yamaoka
2007-11-15  1:15           ` Stefan Monnier
2007-11-15  3:01             ` Katsumi Yamaoka
2007-11-15  3:39               ` Stefan Monnier [this message]
2007-11-15 10:20       ` Katsumi Yamaoka
2007-11-15 11:08         ` Kenichi Handa
2007-11-15 11:41           ` Katsumi Yamaoka
2007-11-15 14:41             ` Kenichi Handa
2007-11-15 23:31               ` Katsumi Yamaoka
2007-11-16  0:51                 ` Kenichi Handa
2007-11-16  1:24                   ` Katsumi Yamaoka
2007-11-16  2:51                     ` Stefan Monnier
2007-11-15 15:22           ` Stefan Monnier
2007-11-16  0:29             ` Kenichi Handa
2007-11-16 10:50             ` Eli Zaretskii
2007-11-13 15:07 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvsl38ji8y.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@ni.aist.go.jp \
    --cc=yamaoka@jpl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).