guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-15-12-g14


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-15-12-g1497e87
Date: Tue, 08 Feb 2011 22:14:14 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=1497e87a4f2eb414dcb2fde306d98013067dd410

The branch, master has been updated
       via  1497e87a4f2eb414dcb2fde306d98013067dd410 (commit)
      from  05e0e22bc58ec4f1d2f96238c3d0c13770f7c5dc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1497e87a4f2eb414dcb2fde306d98013067dd410
Author: Ludovic Courtès <address@hidden>
Date:   Tue Feb 8 23:14:00 2011 +0100

    Make `(format #f ...)' always Unicode-capable.
    
    * module/ice-9/format.scm (format): When DESTINATION is #f, use a
      Unicode-capable output string port.
    
    * test-suite/tests/format.test ("format basic output")["default to
      Unicode-capable port"]: New test.

-----------------------------------------------------------------------

Summary of changes:
 module/ice-9/format.scm      |    5 ++++-
 test-suite/tests/format.test |   14 ++++++++++----
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/module/ice-9/format.scm b/module/ice-9/format.scm
index 7cd0183..c62348d 100644
--- a/module/ice-9/format.scm
+++ b/module/ice-9/format.scm
@@ -41,7 +41,10 @@
 
   (let* ((port
           (cond
-           ((not destination) (open-output-string))
+           ((not destination)
+            ;; Use a Unicode-capable output string port.
+            (with-fluids ((%default-port-encoding "UTF-8"))
+              (open-output-string)))
            ((boolean? destination) (current-output-port)) ; boolean but not 
false
            ((output-port? destination) destination)
            ((number? destination)
diff --git a/test-suite/tests/format.test b/test-suite/tests/format.test
index 25f98f4..24ad835 100644
--- a/test-suite/tests/format.test
+++ b/test-suite/tests/format.test
@@ -1,18 +1,18 @@
 ;;;; format.test --- test suite for Guile's CL-ish format  -*- scheme -*-
 ;;;; Matthias Koeppe <address@hidden> --- June 2001
 ;;;;
-;;;;   Copyright (C) 2001, 2003, 2004, 2006, 2010 Free Software Foundation, 
Inc.
-;;;; 
+;;;; Copyright (C) 2001, 2003, 2004, 2006, 2010, 2011 Free Software 
Foundation, Inc.
+;;;;
 ;;;; This library is free software; you can redistribute it and/or
 ;;;; modify it under the terms of the GNU Lesser General Public
 ;;;; License as published by the Free Software Foundation; either
 ;;;; version 3 of the License, or (at your option) any later version.
-;;;; 
+;;;;
 ;;;; This library is distributed in the hope that it will be useful,
 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;;;; Lesser General Public License for more details.
-;;;; 
+;;;;
 ;;;; You should have received a copy of the GNU Lesser General Public
 ;;;; License along with this library; if not, write to the Free Software
 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
@@ -25,6 +25,12 @@
 ;;; FORMAT Basic Output
 
 (with-test-prefix "format basic output"
+  (pass-if "default to Unicode-capable port"
+    ;; `(format #f ...)' should be able to deal with Unicode characters.
+    (with-fluids ((%default-port-encoding "ISO-8859-1"))
+      (let ((alpha (integer->char #x03b1)))  ; GREEK SMALL LETTER ALPHA
+        (= 1 (string-length (format #f (string alpha)))))))
+
   (pass-if "format ~% produces a new line"
           (string=? (format #f "~%") "\n"))
   (pass-if "format ~& starts a fresh line"


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]