Skip to content

Commit

Permalink
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyRegexp.java
Original file line number Diff line number Diff line change
@@ -1864,7 +1864,7 @@ private static void appendRegexpString19(Ruby runtime, ByteList to, byte[]bytes,
c = enc.mbcToCode(bytes, p, end);
}

if (!Encoding.isAscii(c)) {
if (!Encoding.'isAscii(c)) {
p += StringSupport.length(enc, bytes, p, end);
} else if (c != '/' && enc.isPrint(c)) {
p += cl;
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/string/chomp_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@
* Copyright (C) 2006 Ola Bini <ola@ologix.com>
* Copyright (C) 2007 Nick Sieger <nicksieger@gmail.com>
*
*
* Some of the code in this class is transliterated from C++ code in Rubinius.
*
* Copyright (c) 2007-2014, Evan Phoenix and contributors
@@ -98,7 +99,16 @@ public CharacterAsciiPrimitiveNode(CharacterAsciiPrimitiveNode prev) {

@Specialization
public boolean isCharacterAscii(RubyString character) {
return StringSupport.isAsciiOnly(character);
final ByteList bytes = character.getByteList();
final int codepoint = StringSupport.preciseCodePoint(
bytes.getEncoding(),
bytes.getUnsafeBytes(),
bytes.getBegin(),
bytes.getBegin() + bytes.getRealSize());

final boolean found = codepoint != -1;

return found && Encoding.isAscii(codepoint);
}
}

0 comments on commit ad4dcf0

Please sign in to comment.