From 94b6933d1c6f4c8698319fbcac9dcecc9033b4b9 Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Mon, 7 Dec 2020 17:48:37 +0100 Subject: Set default for Encoding.default_external to UTF-8 on Windows (#2877) * Use UTF-8 as default for Encoding.default_external on Windows * Document UTF-8 change on Windows to Encoding.default_external fix https://bugs.ruby-lang.org/issues/16604 --- encoding.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'encoding.c') diff --git a/encoding.c b/encoding.c index e1441caec2..64748ceb27 100644 --- a/encoding.c +++ b/encoding.c @@ -1684,7 +1684,9 @@ rb_enc_default_external(void) * File data written to disk will be transcoded to the default external * encoding when written, if default_internal is not nil. * - * The default external encoding is initialized by the locale or -E option. + * The default external encoding is initialized by the -E option. + * If -E isn't set, it is initialized to UTF-8 on Windows and the locale on + * other operating systems. */ static VALUE get_default_external(VALUE klass) -- cgit v1.2.3