Skip to content

Instantly share code, notes, and snippets.

@olore
Created June 7, 2013 18:16
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 olore/5731268 to your computer and use it in GitHub Desktop.
Save olore/5731268 to your computer and use it in GitHub Desktop.
trying to do string concatenation with UTF-8 (arabic in this case) characters
# encoding: utf-8
# See http://stackoverflow.com/questions/16989935/ruby-concat-strings-with-utf-8-characters-results-in-strange-ordering
arabic = "أَبْجَدِيَّة عَ"
puts "A #{arabic} end " + " Goodbye " #This is OK because it starts with A
puts "#{arabic} end " + " Goodbye " #" end" is displayed first :(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment