ENTMF 

The UWIDTH Function

The UWIDTH function returns an integer value that is equal to the width in bytes of the nth UTF-8 or UTF-16 character in a character string argument that is encoded in UTF-8 or UTF-16.

The function type is integer.

General Format

Syntax for General Format for the UWIDTH function

Arguments

argument-1
Must be alphabetic, alphanumeric, national, or UTF-8. argument-1 must contain valid UTF-8 or UTF-16 data based on its class:
  • If argument-1 is of class alphabetic, alphanumeric, or UTF-8, it must contain valid UTF-8 data.
  • If argument-1 is of class national, it must contain valid UTF-16 data.
argument-2
The nth UTF-8 or UTF-16 character to locate in argument-1. argument-2 must be a positive integer and not exceed ULENGTH(argument-1), otherwise zero is returned.

Returned Value

The returned value is an integer representing the width in bytes of the nth character in argument-1.

Comments

This function supports ideographic variation selectors (IVS), allowing the font software to select a different glyph from the default. (If no variation exists or supported then the font software will ignore it.) An IVS consists of Unicode characters in the range U-E0100 – U-E01EF. UTF-16 strings use surrogate pairs in the range U-DB40 + DD00 - U-DB40 + DDEF, and UTF-8 strings use the range 0xF3A08480 - 0xF3A087AF.

A Unicode character followed by an IVS is treated as one character when this function is processed.