Wcwidth
A .NET library that calculates the width of Unicode characters.
Install / Use
/learn @spectreconsole/WcwidthREADME
Wcwidth
This is a port of the Python port written by Jeff Quast, which originally was written by Markus Kuhn.
- Python port: https://github.com/jquast/wcwidth (MIT)
- Original: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
Usage
using Wcwidth;
// Get the width
var width = UnicodeCalculator.GetWidth('コ');
// It should be 2 cells wide
Debug.Assert(width == 2);
Building
> dotnet tool restore
After that, running the build is as easy as writing:
> dotnet make
Acknowledgement
This code is a port of https://github.com/jquast/wcwidth, licensed under MIT.
This code was originally derived directly from C code of the same name, whose latest version is available at http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c:
* Markus Kuhn -- 2007-05-26 (Unicode 5.0)
* Permission to use, copy, modify, and distribute this software
* for any purpose and without fee is hereby granted. The author
* disclaims all warranties with regard to this software.
Related Skills
node-connect
346.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
