unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8
@ 2014-09-23 15:10 David Kastrup
  2014-09-24  1:44 ` Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: David Kastrup @ 2014-09-23 15:10 UTC (permalink / raw)
  To: 18536; +Cc: David Kastrup

* 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






^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8
  2014-09-23 15:10 bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8 David Kastrup
@ 2014-09-24  1:44 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2014-09-24  1:44 UTC (permalink / raw)
  To: David Kastrup; +Cc: 18536-done

Pushed to master, commit f7582f9807d9a10fba86f54c4aeaa7444c51a315.
I'm closing this bug now.

     Thanks,
       Mark





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-24  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-23 15:10 bug#18536: [PATCH] Fix unread-string for characters 0x80 <= c < 0xf0 in UTF-8 David Kastrup
2014-09-24  1:44 ` Mark H Weaver

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).