The Crystal Programming Language Forum

Unicode Character & String Width

Published a shard to provide functionality to get fixed width of Unicode characters and String.

9 Likes

This is awesome. Like Unicode Text Segmentation - Grapheme clusters it would be great to merge this into stdlib. I think those are relevant tools for building truly internationalized software and should be included in the standard library.

8 Likes

There’s even a use case in the compiler for this: Formatter calculates the width of a fullwidth character as 1 · Issue #11034 · crystal-lang/crystal · GitHub

1 Like