Skip to content

Commit

Permalink
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -100,6 +100,17 @@ public RubyString stringFromCodepoint(int code, RubyEncoding encoding) {
new ByteList(bytes, encoding.getEncoding()));
}

@Specialization
public RubyString stringFromCodepointSimple(long code, RubyEncoding encoding) {
notDesignedForCompilation();

if (code < Integer.MIN_VALUE || code > Integer.MAX_VALUE) {
throw new UnsupportedOperationException();
}

return stringFromCodepointSimple((int) code, encoding);
}

protected boolean isSimple(int code, RubyEncoding encoding) {
return encoding.getEncoding() == ASCIIEncoding.INSTANCE && code >= 0x00 && code <= 0xFF;
}

0 comments on commit 8ddcf61

Please sign in to comment.