Skip to content

Modern Tui TuiSetAmbiguousWide

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Terminal TUI Library › Unicode Width › TuiSetAmbiguousWide

TuiSetAmbiguousWide

Sets whether characters of ambiguous width count as two columns, for CJK terminals.

Syntax

TuiSetAmbiguousWide( byval on_ as boolean )

Description

Switches the 179 East Asian AMBIGUOUS ranges between 1 and 2 columns. Narrow is the default, which is right for a Western terminal and wrong in a CJK locale. It is GLOBAL on purpose -- a per-call parameter would have to be threaded through every widget.

Example

#import "std/tui"
using tui

print TuiCharWidth( &h00A1 )      '' 1 -- INVERTED EXCLAMATION MARK, ambiguous
TuiSetAmbiguousWide( TRUE )
print TuiCharWidth( &h00A1 )      '' 2 -- now measured as a CJK terminal does
TuiSetAmbiguousWide( FALSE )      '' put it back

See also

TuiCharWidth · TuiStringWidth · TuiTruncate · TuiWrap · TuiAmbiguousWide


Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Unicode Width
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally