From: David Kastrup <dak@gnu.org>
To: 18536@debbugs.gnu.org
Cc: David Kastrup <dak@gnu.org>
Subject: bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8
Date: Tue, 23 Sep 2014 17:10:19 +0200 [thread overview]
Message-ID: <1411485019-768-1-git-send-email-dak@gnu.org> (raw)
* libguile/ports.c (scm_ungetc_unlocked): Fix bad reencoding.
The code
(with-input-from-string ""
(lambda () (unread-string "\"ä\"" (current-input-port)) (read)))
returns "?" instead of "ä". This bug was introduced in
commit be7ecef05c1eea66f30360f658c610710c5cb22e
Signed-off-by: David Kastrup <dak@gnu.org>
---
libguile/ports.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libguile/ports.c b/libguile/ports.c
index 8185d85..3129282 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -2139,7 +2139,7 @@ scm_ungetc_unlocked (scm_t_wchar c, SCM port)
if (pti->encoding_mode == SCM_PORT_ENCODING_MODE_UTF8)
{
- if (c < 0xf0)
+ if (c < 0x80)
{
result_buf[0] = (char) c;
result = result_buf;
--
1.9.1
next reply other threads:[~2014-09-23 15:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-23 15:10 David Kastrup [this message]
2014-09-24 1:44 ` bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8 Mark H Weaver
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/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1411485019-768-1-git-send-email-dak@gnu.org \
--to=dak@gnu.org \
--cc=18536@debbugs.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).