package wcwidth

  1. Overview
  2. Docs
Get terminal display width of a string

Install

Dune Dependency

Authors

Maintainers

Sources

wcwidth-1.0.0.tbz
sha256=228cc4e9aa52c9c0fa0c07c2b4619b9cdac556a2653425b27de1f1aa611f2f12
sha512=f089b80446437d1b39983e386eb3c49aacde6a60f76e5a143a747a394225182a9e57cb6f8ccf2aa954e56f833efd7e160a707cee649fecef6323fb7ccd515d2a

doc/index.html

wcwidth

wcwidth is a small library for calculating the terminal display width of a string. This is often the same as Stdlib.String.length, but differs when 'wide' characters (such as CJK characters or emoji) are used.

The wcwidth and wcswidth C functions are actually defined as part of the POSIX standard (see man 3 wcwidth, for example). This library, however, uses a very minimal reimplementation of the wcwidth Python package.

In principle, this should be a standalone library, not bundled as part of whatwhat. However, I (Jon) am not yet confident enough in the correctness of the code to publish it on OPAM.

The API is very simple: it consists of three functions, and is documented at Wcwidth.

OCaml

Innovation. Community. Security.