Need to work in unicode codepoints? Tired of UTF-8's silliness? You came to the right place!
Examples in the documentation assume an import like this:
import String.UTF32 as UTF32Converts a String to a list of unicode codepoints. The inverse of toString
UTF32.toBytes "hello"
--> [ 0x68, 0x65, 0x6C, 0x6C, 0x6F ]
UTF32.toBytes "💩"
--> [ 0x0001F4A9 ]Build a String from a list of unicode codepoints.
UTF32.toString [ 0x68, 0x65, 0x6C, 0x6C, 0x6F ]
--> "hello"
UTF32.toString [ 0x0001F4A9 ]
--> "💩"Fold over a string, left to right, accumulating unicode codepoints.
Calculates the number UTF-32 characters in a
String.