unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: dick.r.chiang@gmail.com
Cc: 39506@debbugs.gnu.org
Subject: bug#39506: patch
Date: Sat, 08 Feb 2020 14:51:02 -0500	[thread overview]
Message-ID: <jwvh800vp43.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87o8u8ewdj.fsf@dick> (dick r. chiang's message of "Sat, 08 Feb 2020 14:01:44 -0500")

>> - Before deciding whether unibyte or multibyte is the right choice, the
>>   main question is whether the buffer contains bytes or chars.
> My buffer contained some Chinese multibytes.

That suggests it contains characters rather than bytes.  How did
that happen?  Where does this buffer ('s contents) come from?

> You can see my unit test in the patch.

In your unit test, you artificially create a multibyte buffer with
chinese chars, so that doesn't answer my question ;-)

AFAIK `mm-with-part` is designed for MIME parts and MIME parts can only
contain bytes at that point.  Only after we extract them as bytes and
apply `mm-decode-content-transfer-encoding` to it can we consider
decoding those bytes into chars.

So I suspect that the source of your problem is earlier, where some code
incorrectly decodes some content too early.  Hence the need to better
understand where those chinese chars come from.


        Stefan






  reply	other threads:[~2020-02-08 19:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08  0:40 bug#39506: patch dick
2020-02-08 15:10 ` dick.r.chiang
     [not found]   ` <87v9ohdr21.fsf@dick>
2020-02-08 18:32     ` Stefan Monnier
2020-02-08 19:01       ` dick.r.chiang
2020-02-08 19:51         ` Stefan Monnier [this message]
2020-02-20 13:24           ` Lars Ingebrigtsen
2020-02-21 14:34             ` dick.r.chiang

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvh800vp43.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=39506@debbugs.gnu.org \
    --cc=dick.r.chiang@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).