unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#11197: problems with string ports and unicode
@ 2012-04-07 20:07 Klaus Stehle
  2012-04-09 21:12 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Klaus Stehle @ 2012-04-07 20:07 UTC (permalink / raw)
  To: 11197

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1194 bytes --]

Hi,

;;;; a very very short example script to describe the problem:

;; open a string port with unicode characters >= 0x0100
(define p (open-input-string "čtyří"))


Put the line into a script and start guile. You will see the output:
=> Backtrace:

That's all, and guile will hang in an eternal loop.

If you enter the line interactively into the REPL, everything works
properly and you can read all characters with (read-char p).



;;;; another very short script, which is possibly the same problem:

;; open a string port and unread a unicode character >= 0x0100
(define p (open-input-string "ibenik"))
(unread-char #\Š p)


Running these two lines as a script generates an error message:
=> ERROR: In procedure unread-char:
=> ERROR: Throw to key `encoding-error' with args
          `("scm_ungetc" "conversion to port encoding failed" 84 #f #\540)'.

If you enter the lines interactively into the REPL, everything works
properly and you can read all characters with (read-char p).


Cheers,
Klaus Stehle


----------------------------
guile --version
guile (GNU Guile) 2.0.5

uname -srm
Linux 2.6.32-5-amd64 x86_64

echo $LANG
de_DE.UTF-8

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

end of thread, other threads:[~2012-06-20 21:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-07 20:07 bug#11197: problems with string ports and unicode Klaus Stehle
2012-04-09 21:12 ` Ludovic Courtès
2012-04-11 16:08   ` Mark H Weaver
2012-04-11 16:25     ` Ludovic Courtès
2012-04-11 17:53       ` Mark H Weaver
2012-04-11 21:01         ` Ludovic Courtès
2012-06-20 20:58           ` Ludovic Courtès
2012-06-20 21:03           ` Ludovic Courtès

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