Skip to content

Instantly share code, notes, and snippets.

@shaiguitar
Last active December 28, 2015 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaiguitar/7477475 to your computer and use it in GitHub Desktop.
Save shaiguitar/7477475 to your computer and use it in GitHub Desktop.
manual char encodings
class StringHelper
def char_codes_for(str)
new_str = ""
str.each_char { |c| new_str << "&##{c.ord};" }
new_str
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment