We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.9.3-p385 :007 > "\xE6".encoding => #<Encoding:UTF-8> 1.9.3-p385 :008 > "\xE6".valid_encoding? => false 1.9.3-p385 :009 > "\xE6".encode!('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).valid_encoding? => true 1.9.3-p385 :013 > "\xE6".encode!('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).match(/\S/) => #<MatchData "�">
jruby-1.7.13 :016 > "\xE6".encoding => #<Encoding:UTF-8> jruby-1.7.13 :017 > "\xE6".valid_encoding? => false jruby-1.7.13 :018 > "\xE6".encode!('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).valid_encoding? => false jruby-1.7.13 :042 > "\xE6".encode!('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).match(/\S/) ArgumentError: invalid byte sequence in UTF-8 from org/jruby/RubyRegexp.java:1697:in `match' from org/jruby/RubyString.java:1734:in `match' from (irb):42:in `evaluate' from org/jruby/RubyKernel.java:1101:in `eval' from org/jruby/RubyKernel.java:1501:in `loop' from org/jruby/RubyKernel.java:1264:in `catch' from org/jruby/RubyKernel.java:1264:in `catch' from /Users/Shared/lenny/.rvm/rubies/jruby-1.7.13/bin/jirb:13:in `(root)' jruby-1.7.13 :043 >
jruby-1.7.13 :044 > "\xE6".encode('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).valid_encoding? => true jruby-1.7.13 :045 > "\xE6".encode('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).match(/\S/) => #<MatchData "�">
The text was updated successfully, but these errors were encountered:
This has been fixed at least as of JRuby 9k
[7] pry(main)> "\xE6".encoding => #<Encoding:UTF-8> [8] pry(main)> "\xE6".valid_encoding? => false [9] pry(main)> "\xE6".encode!('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).valid_encoding? => true [10] pry(main)> "\xE6".encode!('UTF-8', 'BINARY', :invalid => :replace, :undef => :replace).match(/\S/) => #<MatchData "�"> [11] pry(main)> JRUBY_VERSION => "9.0.0.0" [12] pry(main)>
Sorry, something went wrong.
No branches or pull requests
encode as opposed to #encode! works as expected
The text was updated successfully, but these errors were encountered: