[Top][All Lists]

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-86-ged

From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-86-geda0622
Date: Mon, 24 Jan 2011 20:45:06 +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".

The branch, master has been updated
       via  eda06220952cc93e35711ede68ec800144aaf288 (commit)
      from  bc03d89fa20f3a84743be87a6ad8fb5b08701c93 (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 eda06220952cc93e35711ede68ec800144aaf288
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 24 21:44:44 2011 +0100

    Choose the input source file encoding in a locale-independent way.
    This is so that compiling the same code on environments with different
    locale settings yields the same result.
    * module/system/base/compile.scm (compile-file): When ENC if #f, default
      to "UTF-8" instead of `(fluid-ref %default-port-encoding)'.
    * doc/ref/api-evaluation.texi (Compilation): Document the default output
      file name and default source file encoding for `compile-file' and
      `guile-tools compile'.


Summary of changes:
 doc/ref/api-evaluation.texi    |   11 +++++++++--
 module/system/base/compile.scm |    7 ++++---
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index e20bad4..0a85ec9 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -567,8 +567,9 @@ Add @var{dir} to the front of the module load path.
 @item -o @var{ofile}
 @itemx address@hidden
-Write output bytecode to @var{ofile}.  By convention, bytecode file names end
-in @code{.go}.
+Write output bytecode to @var{ofile}.  By convention, bytecode file
+names end in @code{.go}.  When @option{-o} is omitted, the output file
+name is as for @code{compile-file} (see below).
 @item -W @var{warning}
 @itemx address@hidden
@@ -589,6 +590,9 @@ Use @var{lang} as the target language of @var{file}.  If 
this option is omitted,
 @end table
+Each @var{file} is assumed to be UTF-8-encoded, unless it contains a
+coding declaration as recognized by @code{file-encoding}
+(@pxref{Character Encoding of Source Files}).
 @end deffn
 The compiler can also be invoked directly by Scheme code using the procedures
@@ -608,6 +612,9 @@ Compile the file named @var{file}.
 Output will be written to a file in the current directory whose name
 is computed as @code{(compiled-file-name @var{file})}.
+As with @command{guile-tools compile}, @var{file} is assumed to be
+UTF-8-encoded unless it contains a coding declaration.
 @end deffn
 @deffn {Scheme Procedure} compiled-file-name file
diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm
index 7c83fd7..35dc0b1 100644
--- a/module/system/base/compile.scm
+++ b/module/system/base/compile.scm
@@ -1,6 +1,6 @@
 ;;; High-level compiler interface
-;; Copyright (C) 2001, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2001, 2009, 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
@@ -120,8 +120,9 @@
     (let* ((comp (or output-file (compiled-file-name file)))
            (in (open-input-file file))
            (enc (file-encoding in)))
-      (if enc
-          (set-port-encoding! in enc))
+      ;; Choose the input encoding deterministically.
+      (set-port-encoding! in (or enc "UTF-8"))
       (ensure-writable-dir (dirname comp))
       (call-with-output-file/atomic comp
         (lambda (port)

GNU Guile

reply via email to

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