std/text/unicode▲toc

Basic unicode support.

.

alias graphemestd/text/unicode/grapheme: V = stringstd/core/types/string: V

Grapheme's are an alias for stringstd/core/types/string: V. Each grapheme is a self-contained symbol consisting of a unicode character followed by combining characters and/or combining marks.

type normalizationstd/text/unicode/normalization: V

Type of unicode normalization.

con NFC

Canonical composition (default). Use composed characters when possible.

con NFD

Canonical decomposition.

con NFKC

Compatibility composition.

con NFKD

Compatibility decomposition.

fun graphemes( s : stringstd/core/types/string: V ) : liststd/core/list: V -> V<graphemestd/text/unicode/grapheme: V>

Convert a string to a list of graphemes. Each grapheme will be in NFCstd/text/unicode/NFC: normalization normalized form.

fun is-combining( c : charstd/core/types/char: V ) : boolstd/core/types/bool: V

Is this a combining character?

fun normalize( s : stringstd/core/types/string: V, norm : ?normalizationstd/text/unicode/normalization: V ) : stringstd/core/types/string: V

Normalize a unicode string. If no normalization form is given, NFCstd/text/unicode/NFC: normalization is used.

fun width( c : charstd/core/types/char: V ) : intstd/core/types/int: V

Return the column-width of a unicode character. Equivalent to wcwidth.

fun width( s : stringstd/core/types/string: V ) : intstd/core/types/int: V

Return the total column-width of a string.

private import std/core/typesstd/core/types, std/core/hndstd/core/hnd, std/corestd/core