devShakib

Loading devShakib…

TextKit

A text-utilities multitool — transform, count, encode and generate text, all on-device.

The text operations people need repeatedly are small, individually trivial, and collectively worth having in one place: changing case, counting, encoding, slugifying, cleaning whitespace.

Each hides an edge case. Case conversion is locale-dependent — Turkish has a dotless i, so uppercasing with the wrong locale changes the letter. Counting characters means choosing between code units, code points and grapheme clusters, which give three different answers for an emoji. Whitespace cleaning has to handle non-breaking spaces, which look identical to ordinary ones and are why an exact-match comparison fails for no visible reason.