Created
June 4, 2012 18:00
-
-
Save tddium/2869891 to your computer and use it in GitHub Desktop.
Ruby 1.9.3-p0 vs 1.9.3-p194 Encoding Madness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
opts = {:invalid => :replace, :undef => :replace, :replace => '', :newline => :universal} | |
s, b = 'ード', 'بلآ' | |
puts s.encoding.name | |
s.to_s.encode('UTF-8', opts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment