Skip to content

Commit

Permalink
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -2080,7 +2080,7 @@ public static RubyString inspect(final Ruby runtime, ByteList byteList) {
int end = p + byteList.getRealSize();
RubyString result = new RubyString(runtime, runtime.getString(), new ByteList(end - p));
Encoding resultEnc = runtime.getDefaultInternalEncoding();
boolean isUnicode = StringSupport.isUnicode(enc);
boolean isUnicode = enc.isUnicode();
boolean asciiCompat = enc.isAsciiCompatible();


2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/RegexpSupport.java
Original file line number Diff line number Diff line change
@@ -224,7 +224,7 @@ public static void appendRegexpString19(Ruby runtime, ByteList to, byte[] bytes,
if (!needEscape) {
to.append(bytes, start, len);
} else {
boolean isUnicode = StringSupport.isUnicode(enc);
boolean isUnicode = enc.isUnicode();
p = start;
while (p < end) {
final int c;
10 changes: 5 additions & 5 deletions core/src/main/java/org/jruby/util/StringSupport.java
Original file line number Diff line number Diff line change
@@ -637,11 +637,6 @@ public static final void checkStringSafety(Ruby runtime, IRubyObject value) {
}
}

public static boolean isUnicode(Encoding enc) {
byte[] name = enc.getName();
return name.length > 4 && name[0] == 'U' && name[1] == 'T' && name[2] == 'F' && name[4] != '7';
}

public static String escapedCharFormat(int c, boolean isUnicode) {
String format;
// c comparisons must be unsigned 32-bit
@@ -2430,4 +2425,9 @@ public static boolean multiByteUpcase(Encoding enc, byte[] bytes, int s, int end
public static int encCoderangeClean(int cr) {
return (cr ^ (cr >> 1)) & CR_7BIT;
}

@Deprecated
public static boolean isUnicode(Encoding enc) {
return enc.isUnicode();
}
}

0 comments on commit c2d72a3

Please sign in to comment.