summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;