Created
September 26, 2011 01:35
-
-
Save smtalim/1241425 to your computer and use it in GitHub Desktop.
Ruby code for encoding
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
# encoding: utf-8 | |
# λ is the Greek character Lambda here | |
puts "λ".length # => 1 | |
puts "λ".bytesize # => 2 | |
puts "λ".encoding # => UTF-8 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I't didn't work.. :(
Encoding.rb:6: undefined method `encoding' for "\316\273":String (NoMethodError)