Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c19cc447f2b0
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 24ba95ae2ab9
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Mar 16, 2015

  1. Copy the full SHA
    6e883c5 View commit details
  2. Revert "Fix jcodings mapping for UTF-32 and UTF-16 (to BE). Fixes #2581

    …."
    
    This reverts commit 3f5a605.
    
    Conflicts:
    	core/pom.xml
    headius committed Mar 16, 2015
    Copy the full SHA
    24ba95a View commit details
Showing with 4 additions and 17 deletions.
  1. +1 −1 core/pom.xml
  2. +3 −6 core/src/main/java/org/jruby/RubyString.java
  3. +0 −10 spec/regression/GH-2581_utf32_should_alias_utf32be_spec.rb
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -142,7 +142,7 @@
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.13-SNAPSHOT</version>
<version>1.0.10</version>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
9 changes: 3 additions & 6 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -2088,7 +2088,6 @@ public static IRubyObject inspect19(Ruby runtime, ByteList byteList) {
result.associateEncoding(resultEnc);

boolean isUnicode = StringSupport.isUnicode(enc);
boolean asciiCompat = enc.isAsciiCompatible();

EncodingDB.Entry e = null;
CaseInsensitiveBytesHash<EncodingDB.Entry> encodings = runtime.getEncodingService().getEncodings();
@@ -2101,7 +2100,6 @@ public static IRubyObject inspect19(Ruby runtime, ByteList byteList) {
} else if (c0 == 0xFF && c1 == 0xFE) {
e = encodings.get("UTF-16LE".getBytes());
} else {
e = encodings.get("ASCII-8BIT".getBytes());
isUnicode = false;
}
} else if (enc == encodings.get("UTF-32".getBytes()).getEncoding() && end - p > 3) {
@@ -2115,7 +2113,6 @@ public static IRubyObject inspect19(Ruby runtime, ByteList byteList) {
} else if (c3 == 0 && c2 == 0 && c1 == 0xFE && c0 == 0xFF) {
e = encodings.get("UTF-32LE".getBytes());
} else {
e = encodings.get("ASCII-8BIT".getBytes());
isUnicode = false;
}
}
@@ -2140,13 +2137,13 @@ public static IRubyObject inspect19(Ruby runtime, ByteList byteList) {
}
int c = enc.mbcToCode(bytes, p, end);
p += n;
if ((asciiCompat || isUnicode) &&
if ((enc.isAsciiCompatible() || isUnicode) &&
(c == '"' || c == '\\' ||
(c == '#' && p < end && (StringSupport.preciseLength(enc, bytes, p, end) > 0) &&
(cc = codePoint(runtime, enc, bytes, p, end)) == '$' || cc == '@' || cc == '{'))) {
if (p - n > prev) result.cat(bytes, prev, p - n - prev);
result.cat('\\');
if (asciiCompat || enc == resultEnc) {
if (enc.isAsciiCompatible() || enc == resultEnc) {
prev = p - n;
continue;
}
@@ -2172,7 +2169,7 @@ public static IRubyObject inspect19(Ruby runtime, ByteList byteList) {
continue;
}

if ((enc == resultEnc && enc.isPrint(c)) || (asciiCompat && Encoding.isAscii(c) && enc.isPrint(c))) {
if ((enc == resultEnc && enc.isPrint(c)) || (enc.isAsciiCompatible() && Encoding.isAscii(c) && enc.isPrint(c))) {
continue;
} else {
if (p - n > prev) result.cat(bytes, prev, p - n - prev);
10 changes: 0 additions & 10 deletions spec/regression/GH-2581_utf32_should_alias_utf32be_spec.rb

This file was deleted.