From 0de6bced1648542f7c2c2575d2ecd68cf084d9ab Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Mon, 9 Oct 2023 22:05:40 -0500 Subject: [PATCH] Try using US-ASCII bytelists for all compat --- core/src/main/java/org/jruby/RubyInteger.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/jruby/RubyInteger.java b/core/src/main/java/org/jruby/RubyInteger.java index df87603652a8..44c7b4442062 100644 --- a/core/src/main/java/org/jruby/RubyInteger.java +++ b/core/src/main/java/org/jruby/RubyInteger.java @@ -441,7 +441,7 @@ public static ByteList singleCharUTF8ByteList(final byte index) { */ public static RubyString singleCharString(Ruby runtime, byte b, RubyClass meta, Encoding enc) { ByteList bytes; - if (enc == USASCIIEncoding.INSTANCE) { + if (enc.isAsciiCompatible()) { bytes = singleCharByteList(b); } else if (Byte.toUnsignedInt(b) < 0x80 && enc == RubyString.UTF8) { bytes = singleCharUTF8ByteList(b);