Skip to content

Commit a3b035b

Browse files
committed
Default external to locale as in CRuby
1 parent a4a084b commit a3b035b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

core/src/main/java/org/jruby/runtime/encoding/EncodingService.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,7 @@ private void defineEncodingConstant(Ruby runtime, RubyEncoding encoding, String
241241
public IRubyObject getDefaultExternal() {
242242
Encoding defaultEncoding = runtime.getDefaultExternalEncoding();
243243
if (defaultEncoding == null) {
244-
// TODO: MRI seems to default blindly to US-ASCII and we were using Charset default from Java...which is right?
245-
ByteList encodingName = ByteList.create("US-ASCII");
246-
defaultEncoding = runtime.getEncodingService().loadEncoding(encodingName);
247-
248-
runtime.setDefaultExternalEncoding(defaultEncoding);
244+
defaultEncoding = getLocaleEncoding();
249245
}
250246
return getEncoding(defaultEncoding);
251247
}

0 commit comments

Comments
 (0)