Created
September 14, 2016 19:02
-
-
Save jbranchaud/5a7786bac1ed5ade103bdd740ea52857 to your computer and use it in GitHub Desktop.
Elixir String Graphemes, Codepoints, Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> string1 = "\u0065\u0301" | |
"é" | |
> string2 = "é" | |
"é" | |
> string1 == string2 | |
false | |
> String.codepoints(string1) | |
["e", "́"] | |
> String.codepoints(string2) | |
["é"] | |
> byte_size(string1) | |
3 | |
> byte_size(string2) | |
2 | |
> String.graphemes(string1) | |
["é"] | |
> String.graphemes(string2) | |
["é"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment