Skip to content

Instantly share code, notes, and snippets.

@olleolleolle
Last active October 30, 2017 15:38
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 olleolleolle/c2c5d9287206f6712e4cd21945d0e324 to your computer and use it in GitHub Desktop.
Save olleolleolle/c2c5d9287206f6712e4cd21945d0e324 to your computer and use it in GitHub Desktop.
Swedish characters are hard to pick up graphemes for

MRI

2.4.2 :038 > 'åäöÅÄÖ'.unicode_normalize(:nfd).scan(/\X/)
 => ["å", "ä", "ö", "Å", "Ä", "Ö"]
 

JRuby

jruby-9.1.13.0 :001 > 'åäöÅÄÖ'.unicode_normalize(:nfd).scan(/\X/)
 => ["a", "a", "o", "A", "A", "O"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment