Created
January 17, 2016 07:52
-
-
Save cho45/737d04526ab3fd8e3c05 to your computer and use it in GitHub Desktop.
This file contains 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
#!ruby -v | |
string = "\xA9foobar".force_encoding("ASCII-8BIT") | |
p string.unpack("C*") == "\xA9foobar".unpack("C*") | |
#=> true | |
p string == "\xA9foobar" | |
#=> false (depends on magic comment, default literal is UTF-8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment