Skip to content

Commit

Permalink
Try using US-ASCII bytelists for all compat
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Oct 10, 2023
1 parent 46fc31b commit 0de6bce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyInteger.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0de6bce

Please sign in to comment.