all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Helmut Eller <eller.helmut@gmail.com>
Cc: 7279@debbugs.gnu.org, Andreas Schwab <schwab@linux-m68k.org>
Subject: bug#7279: 24.0.50; print-escape-multibyte not honored
Date: Mon, 30 Jan 2017 02:12:58 -0500	[thread overview]
Message-ID: <87poj5qav9.fsf@users.sourceforge.net> (raw)
In-Reply-To: <m24ocaw0u1.fsf@gmail.com> (Helmut Eller's message of "Mon, 25 Oct 2010 21:04:38 +0200")

tags 7279 notabug
close 7279
quit

Helmut Eller <eller.helmut@gmail.com> writes:

> * Andreas Schwab [2010-10-25 18:02] writes:
>
>> Helmut Eller <eller.helmut@gmail.com> writes:
>>
>>> This code:
>>>
>>> (with-temp-file "/tmp/x.x"
>>>   (let ((print-escape-multibyte nil))
>>>     (prin1 (string ?\x03bb) (current-buffer))))
>>>
>>> writes "\x03bb" to the file, i.e. it seems to ignore the value
>>> of print-escape-multibyte.
>>
>> I cannot reprodoce that.  I also tried setting print-escape-multibyte to
>> t and got the expected effect.  Note that print-escape-multibyte is nil
>> by default anyway.
>
> And this?
>
> (with-temp-file "/tmp/x.x"
>   (set-buffer-multibyte nil)
>   (let ((print-escape-multibyte nil))
>     (prin1 (string ?\x80) (current-buffer))))
>

You can't print a multibyte string into a unibyte buffer, this works:

(with-temp-file "/tmp/x.x"
  (set-buffer-multibyte nil)
  (let ((print-escape-multibyte nil))
    (prin1 (unibyte-string ?\x80) (current-buffer))))

or if you want to handle unicode you must choose an encoding:

(with-temp-file "/tmp/x.x"
  (set-buffer-multibyte nil)
  (let ((print-escape-multibyte nil))
    (prin1 (encode-coding-string (string ?\x03bb) 'utf-8)
           (current-buffer))))





      reply	other threads:[~2017-01-30  7:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-25 11:39 bug#7279: 24.0.50; print-escape-multibyte not honored Helmut Eller
2010-10-25 18:02 ` Andreas Schwab
2010-10-25 19:04   ` Helmut Eller
2017-01-30  7:12     ` npostavs [this message]

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=87poj5qav9.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=7279@debbugs.gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=schwab@linux-m68k.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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.