Skip to content

Instantly share code, notes, and snippets.

@smtalim
Created September 26, 2011 01:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smtalim/1241425 to your computer and use it in GitHub Desktop.
Save smtalim/1241425 to your computer and use it in GitHub Desktop.
Ruby code for encoding
# encoding: utf-8
# λ is the Greek character Lambda here
puts "λ".length # => 1
puts "λ".bytesize # => 2
puts "λ".encoding # => UTF-8
@SuEric
Copy link

SuEric commented Feb 10, 2013

I't didn't work.. :(
Encoding.rb:6: undefined method `encoding' for "\316\273":String (NoMethodError)

@connerm
Copy link

connerm commented May 30, 2013

Cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment