Subject: bug#11197: problems with string ports and unicode

From: [email-masked] (Ludovic Courtès)
Date: Wed, 20 Jun 2012 22:58:39 +0200

Hi,

[email-masked] (Ludovic Courtès) skribis:

> @@ -23,10 +23,16 @@
>  ;;; Code:
>  
>  (define-module (srfi srfi-6)
> -  #:re-export (open-input-string open-output-string get-output-string))
> +  #:export (open-input-string open-output-string)
> +  #:re-export (get-output-string))
>  
> -;; Currently, guile provides these functions by default, so no action
> -;; is needed, and this file is just a placeholder.
> +(define (open-input-string s)
> +  (with-fluids ((%default-port-encoding "UTF-8"))
> +    ((@ (guile) open-input-string) s)))
> +
> +(define (open-output-string)
> +  (with-fluids ((%default-port-encoding "UTF-8"))
> +    ((@ (guile) open-output-string))))

I’ve applied it as commit ecb48dccbac6b8fdd969f50a23351ef7f4b91ce5.

Thanks,
Ludo’.