Skip to content

Instantly share code, notes, and snippets.

@cris
Created February 24, 2011 11:11
Show Gist options
  • Save cris/842052 to your computer and use it in GitHub Desktop.
Save cris/842052 to your computer and use it in GitHub Desktop.
Use of codepoint feature in Ruby 1.9.2
("а".ord.."я".ord).map {|cp| cp.chr('UTF-8')}
# => ["а", "б", "в", "г", "д", "е", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment