Liking cljdoc? Tell your friends :D

wcwidth.api


code-point-to-stringclj

(code-point-to-string code-point)

Returns the string representation of any Unicode code-point†.

This is useful because Clojure/Java string literals only support escape sequences for code-points in the basic plane, which involves manual conversion of all supplementary code-points into pairs of escapes.

†a character or integer, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Returns the string representation of any Unicode code-point†.

This is useful because Clojure/Java string literals only support escape
sequences for code-points in the basic plane, which involves manual conversion
of all supplementary code-points into pairs of escapes.

†a character or integer, but note that Java/Clojure characters are limited to
the Unicode basic plane (first 0xFFFF code-points) for historical reasons
sourceraw docstring

code-points-to-stringclj

(code-points-to-string code-points)

Returns a string made up of all of the given code-points†

†a sequence of characters or integers, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Returns a string made up of all of the given code-points†

†a sequence of characters or integers, but note that Java/Clojure characters
are limited to the Unicode basic plane (first 0xFFFF code-points) for
historical reasons
sourceraw docstring

combining?clj

(combining? code-point)

Is code-point† a combining character?

†a character or integer, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Is code-point† a combining character?

†a character or integer, but note that Java/Clojure characters are limited to
the Unicode basic plane (first 0xFFFF code-points) for historical reasons
sourceraw docstring

display-widthclj

(display-width s)
(display-width s & {:keys [ignore-ansi?] :or {ignore-ansi? false}})

Returns the number of columns needed to display String s, but deviates from POSIX wcswidth behaviour in some key ways i.e. non-printing characters are considered 0 width (instead of causing the entire result to be -1), and ANSI escape sequences are (by default) also considered zero width.

For most use cases, this function is generally more useful than wcswidth, despite not adhering to POSIX.

Returns the number of columns needed to display String s, but deviates from
POSIX wcswidth behaviour in some key ways i.e. non-printing characters are
considered 0 width (instead of causing the entire result to be -1), and ANSI
escape sequences are (by default) also considered zero width.

For most use cases, this function is generally more useful than wcswidth,
despite not adhering to POSIX.
sourceraw docstring

non-printing?clj

(non-printing? code-point)

Is code-point† a non-printing character?

†a character or integer, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Is code-point† a non-printing character?

†a character or integer, but note that Java/Clojure characters are limited to
the Unicode basic plane (first 0xFFFF code-points) for historical reasons
sourceraw docstring

null?clj

(null? code-point)

Is code-point† a null character?

†a character or integer, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Is code-point† a null character?

†a character or integer, but note that Java/Clojure characters are limited to
the Unicode basic plane (first 0xFFFF code-points) for historical reasons
sourceraw docstring

remove-ansiclj

(remove-ansi s)

Strips all ANSI escape sequences from the given String.

Strips all ANSI escape sequences from the given String.
sourceraw docstring

string-to-code-pointsclj

(string-to-code-points s)

Returns all of the Unicode code-points in s, as a sequence of integers.

Returns all of the Unicode code-points in s, as a sequence of integers.
sourceraw docstring

wcswidthclj

(wcswidth s)

Returns the number of columns needed to represent String s. If a non-printing code-point occurs in s, -1 is returned.

Returns the number of columns needed to represent String s. If a non-printing
code-point occurs in s, -1 is returned.
sourceraw docstring

wcwidthclj

(wcwidth code-point)

Returns the number of columns needed to represent the code-point†. If code-point is a printable character, the value is at least 0. If code-point is a null character, the value is 0. Otherwise, -1 is returned (the code-point is non-printing).

†a character or integer, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Returns the number of columns needed to represent the code-point†. If
code-point is a printable character, the value is at least 0. If code-point is
a null character, the value is 0. Otherwise, -1 is returned (the code-point is
non-printing).

†a character or integer, but note that Java/Clojure characters are limited to
the Unicode basic plane (first 0xFFFF code-points) for historical reasons
sourceraw docstring

wide?clj

(wide? code-point)

Is code-point† in the East Asian Wide (W), East Asian Full-width (F), or other wide character (e.g. emoji) category?

†a character or integer, but note that Java/Clojure characters are limited to the Unicode basic plane (first 0xFFFF code-points) for historical reasons

Is code-point† in the East Asian Wide (W), East Asian Full-width (F), or
other wide character (e.g. emoji) category?

†a character or integer, but note that Java/Clojure characters are limited to
the Unicode basic plane (first 0xFFFF code-points) for historical reasons
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close