Normalize
A library for normalizing unicode text. Implements all the Unicode Normalization Form algorithms. Normalization is buffered and takes O(n) time and O(1).
Note: the
iterator
version takes O(1) space, but theproc
takes O(n) space.
Usage
import normalize
echo toNFC("E◌̀") # @[Rune(0x00C8)]
# È
echo toNFD("È") # @[Rune(0x0045), Rune(0x0300)]
# E◌̀
# toNFKC and toNFKD are also available
Note: when printing to a terminal, the output may visually trick you. Better try printing the len or the runes
Tests
nimble tests
nimble tests2
LICENSE
MIT