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);