diff options
author | Ludovic Courtès | 2011-03-10 18:57:41 +0100 |
---|---|---|
committer | Ludovic Courtès | 2011-03-10 18:57:41 +0100 |
commit | 65f2f4532fb0f04292d8207b801d128fa5e226d1 (patch) | |
tree | 62096efbc9ea9e44becd0270db8043116ce8a031 /src/guile/skribilo.scm | |
parent | 8e42aef17f1e0e44fcd4aef39ee3f387e644c12b (diff) | |
download | skribilo-65f2f4532fb0f04292d8207b801d128fa5e226d1.tar.gz skribilo-65f2f4532fb0f04292d8207b801d128fa5e226d1.tar.lz skribilo-65f2f4532fb0f04292d8207b801d128fa5e226d1.zip |
Set `%default-port-encoding' to "UTF-8".
* src/guile/skribilo/utils/syntax.scm (default-to-utf-8): New macro.
* src/guile/skribilo.scm (skribilo): Use it around `(doskribe)'.
Diffstat (limited to 'src/guile/skribilo.scm')
-rw-r--r-- | src/guile/skribilo.scm | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/guile/skribilo.scm b/src/guile/skribilo.scm index 985e0cd..8bd3b9a 100644 --- a/src/guile/skribilo.scm +++ b/src/guile/skribilo.scm @@ -1,6 +1,6 @@ ;;; skribilo.scm -- The Skribilo document processor. ;;; -;;; Copyright 2005, 2006, 2007, 2008, 2009 Ludovic Courtès <ludo@gnu.org> +;;; Copyright 2005, 2006, 2007, 2008, 2009, 2011 Ludovic Courtès <ludo@gnu.org> ;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr> ;;; ;;; @@ -375,24 +375,27 @@ options." (if (and output-file (file-exists? output-file)) (delete-file output-file)) - (parameterize ((*destination-file* output-file) - (*source-file* input-file) - (*skribilo-output-port* - (if (string? output-file) - (open-output-file output-file) - (current-output-port)))) - - (setvbuf (*skribilo-output-port*) _IOFBF 16384) - - (if input-file - (with-input-from-file input-file - (lambda () - (set-correct-file-encoding!) - (doskribe user-module))) - (doskribe user-module)) - - ;; Make sure the output port is flushed before we leave. - (force-output (*skribilo-output-port*)))))) + ;; Choose UTF-8 as the default encoding so that string ports will + ;; accept all of Unicode. + (default-to-utf-8 + (parameterize ((*destination-file* output-file) + (*source-file* input-file) + (*skribilo-output-port* + (if (string? output-file) + (open-output-file output-file) + (current-output-port)))) + + (setvbuf (*skribilo-output-port*) _IOFBF 16384) + + (if input-file + (with-input-from-file input-file + (lambda () + (set-correct-file-encoding!) + (doskribe user-module))) + (doskribe user-module)) + + ;; Make sure the output port is flushed before we leave. + (force-output (*skribilo-output-port*))))))) ;;; Local Variables: |