Hi everyone! I’m excited to share uniwidth, a Unicode width calculation library I built for the Phoenix TUI Framework.

Why I built this

While working on Phoenix TUI, I hit a performance bottleneck with existing width calculation libraries. Terminal rendering needs to calculate character widths millions of times per second, and the overhead was noticeable. So I built uniwidth from scratch with performance as the primary goal.

What makes it fast

The library uses a tiered lookup strategy that handles ~95% of cases in O(1):

ASCII fast path (simple range check, no binary search)

Common CJK ranges (Unified Ideographs, Hangul, Hiragana/Katakana)

Common emoji ranges (Emoticons, Pictographs)

Binary search fallback…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help