Utf8.width

From GiderosMobile
Revision as of 11:05, 23 August 2018 by Hgy29 (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2016.06<br/> === Description === calculate the width of UTF-8 string s. if ambi_is_double is given, the ambiguous width character's wi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2016.06

Description

calculate the width of UTF-8 string s. if ambi_is_double is given, the ambiguous width character's width is 2, otherwise it's 1. fullwidth/doublewidth character's width is 2, and other character's width is 1. if default_width is given, it will be the width of unprintable character, used display a non-character mark for these characters. if s is a code point, return the width of this code point.

(number), = utf8.width(sambi_is_doubledefault_width,)

's: (string) '
ambi_is_double: (boolean) optional
default_width: (number) optional
Returns (number) width