Skip to content

Instantly share code, notes, and snippets.

@MrJaba MrJaba/test.rb
Created Apr 25, 2012

Embed
What would you like to do?
JRuby oddness?
# jruby 1.6.7 (ruby-1.9.2-p312)
require 'open-uri'
a = open("http://pinterest.com/pin/56295064062363076/").read
a.encoding
=> #<Encoding:UTF-8>
b = StringIO.new(a).read
b.encoding
=> #<Encoding:ASCII-8BIT>
Encoding.default_internal
=> nil
Encoding.default_external
=> #<Encoding:UTF-8>
# ruby 1.9.3p194 (2012-04-20 revision 35410)
require 'open-uri'
a = open("http://pinterest.com/pin/56295064062363076/").read
a.encoding
=> #<Encoding:UTF-8>
b = StringIO.new(a).read
b.encoding
=> #<Encoding:UTF-8>
Encoding.default_internal
=> nil
Encoding.default_external
=> #<Encoding:UTF-8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.