summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-06-24 07:43:58 +0200
committerAndy Wingo <wingo@pobox.com>2016-07-11 18:21:52 +0200
commite2c1659d953bb4973e612a041380ca2439b70a3e (patch)
tree9a5066c1c18e22c0ed9e6b6438533090d5626ee0
parenta14e873cce0700cb0a84dd03632e542bd0223637 (diff)
downloadguile-e2c1659d953bb4973e612a041380ca2439b70a3e.tar.gz
Locale is default port encoding
* libguile/ports.c (scm_init_ports): Use the locale as the default charset. This allows GUILE_INSTALL_LOCALE=1 to work properly, harmonizing the default port encoding with the installed locale.
-rw-r--r--NEWS1
-rw-r--r--libguile/ports.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 36ab4c085..17b98c2b7 100644
--- a/NEWS
+++ b/NEWS
@@ -148,6 +148,7 @@ More ARM cross-compilation targets are supported: "arm.*eb",
(<http://bugs.gnu.org/19883>)
** Ports
+*** Setting GUILE_INSTALL_LOCALE=1 sets port default charset from locale
*** Fix port position handling on binary input ports
(<http://bugs.gnu.org/20302>)
*** Bytevector and custom binary ports to use ISO-8859-1
diff --git a/libguile/ports.c b/libguile/ports.c
index d7459b3ef..5a756b78e 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -2911,6 +2911,9 @@ scm_init_ports ()
scm_make_fluid_with_default (SCM_BOOL_F));
scm_port_encoding_init = 1;
+ /* Use the locale as the default port encoding. */
+ scm_i_set_default_port_encoding (locale_charset ());
+
SCM_VARIABLE_SET (default_conversion_strategy_var,
scm_make_fluid_with_default (sym_substitute));
scm_conversion_strategy_init = 1;