Wrong handling of "special" letters encoded in utf-8
----------------------------------------------------
Key: JRUBY-5931
URL: https://jira.codehaus.org/browse/JRUBY-5931
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.5.6
Environment: tested on linux, osx and solaris
Reporter: Dominique Ribaut
Assignee: Thomas E Enebo
#Rspec test case (pass with ruby 1.9.2)
module JRubyStringBug
describe "Wrong handling of special characters in UTF-8" do
it "should report length of strings correctly even with norwegian letters"
do
"it should cut this string after æøåæøå".length.should == 38
end
# expected: 38,
# got: 44 (using ==)
it "should cut the string at 35 characters even with norwegian letters" do
"it should cut this string after æøåæøå".slice(0, 35).should == "it
should cut this string after æøå"
end
# expected: "it should cut this string after \303\246\303\270\303\245",
# got: "it should cut this string after \303\246\303" (using ==)
end
end
#from the stack trace in prod with the same string(Solaris):
ArgumentError - malformed UTF-8 character (expected 2 bytes, given 1 bytes):
org/jruby/RubyString.java:7095:in `unpack'
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email