Last active
July 11, 2018 11:14
-
-
Save jdzak/ad38a9efd3444ddd85b8bfb69974a19c to your computer and use it in GitHub Desktop.
Encoding Fun with Kara
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
>> File.open("/Users/tablexi/Desktop/utf8", "r:UTF-8") { |f| f.each { |b| puts b.each_codepoint.to_a } } | |
241 | |
10 | |
=> #<File:/Users/tablexi/Desktop/utf8 (closed)> | |
>> File.open("/Users/tablexi/Desktop/latin1", "r:ISO-8859-1") { |f| f.each { |b| puts b.each_codepoint.to_a } } | |
241 | |
10 | |
=> #<File:/Users/tablexi/Desktop/latin1 (closed)> | |
>> File.open("/Users/tablexi/Desktop/latin1", "r:ISO-8859-1") { |f| f.each { |b| puts b.bytes } } | |
241 | |
10 | |
=> #<File:/Users/tablexi/Desktop/latin1 (closed)> | |
>> File.open("/Users/tablexi/Desktop/utf8", "r:UTF-8") { |f| f.each { |b| puts b.bytes } } | |
195 | |
177 | |
10 | |
=> #<File:/Users/tablexi/Desktop/utf8 (closed)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment