Skip to content

Commit

Permalink
Fix jcodings mapping for UTF-32 and UTF-16 (to BE). Fixes #2581.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Mar 12, 2015
1 parent 5433238 commit 3f5a605
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -92,7 +92,7 @@
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.10</version>
<version>1.0.13-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
Expand Down
10 changes: 10 additions & 0 deletions spec/regression/GH-2581_utf32_should_alias_utf32be_spec.rb
@@ -0,0 +1,10 @@
if RUBY_VERSION >= "1.9"
describe "A string encoded as 'UTF-32'" do
it "transcodes as UTF-32BE" do
a = "a"
a32 = a.encode("UTF-32")
a8 = a32.encode(Encoding::UTF_8)
expect(a8).to eq(a)
end
end
end

2 comments on commit 3f5a605

@kares
Copy link
Member

@kares kares commented on 3f5a605 Mar 30, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-running some travis-ci tests recently with this commit reveals that it introduced issues :

these 2 branches are essentially the same except for the commit :

... most of the failures are not on latest jruby-1_7 but at least one encoding regression spec seems to persist ;(

@headius
Copy link
Member Author

@headius headius commented on 3f5a605 Apr 6, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed that bad encoding by skipping dummy encodings. MRI does this in a number of tests, since dummy encodings often will roundtrip back to the encoding they're based on, failing tests.

Please sign in to comment.