Skip to main content

$ZZENKAKU (ObjectScript)

Converts Japanese katakana characters from half-width to full-width.

Synopsis

$ZZENKAKU(expression,flag1,flag2)

Arguments

Argument Description
expression A string containing half-width characters. These characters may be katakana characters, Roman alphabet letters, or numbers.
flag1 Optional — A boolean flag to indicate whether to convert half-with katakana to full-width hiragana (0) or full-width katakana (1).
flag2 Optional — A boolean flag to indicate whether voiced sound processing is required (1) or not required (0).

Description

$ZZENKAKU converts Japanese katakana characters from half-width (hankaku) to full-width (zenkaku) characters. It also converts strings of Roman alphabet letters ("ABC") and Arabic numbers (123) from half-width to full-width.

$ZZENKAKU can, optionally, convert half-width katakana to full-width hiragana. Katakana characters are commonly used for foreign terms and foreign loan words; they can be represented as half-width or full-width characters. Hiragana characters are the more standard way of writing Japanese. Hiragana is always full-width.

If flag1 is 0, $ZZENKAKU converts printable ASCII characters to their full-width counterparts and converts half-width katakana characters to full-width hiragana characters. The default value for flag1 is 0.

If flag1 is 1, $ZZENKAKU converts printable ASCII characters to their full-width counterparts and converts half-width katakana characters to full-width katakana characters.

If flag2 is 1 and a half-width katakana character is followed by a voice sound mark or a semi-voice sound mark, then (if appropriate) $ZZENKAKU combines the half-width katakana character and the sound mark character into a target full-width hiragana or katakana character. The default value for flag2 is 1.

You can set the physical cursor to use two physical spaces for a character as system-wide behavior by setting the PhysicalCursorOpens in a new tab property of the Config.NLS.LocalesOpens in a new tab class.

The $WASCII function (and other $W functions) supports surrogate pairs of characters used to encode some Japanese kanji characters. For the ZFWCHARZ and ZHWKATAZ Japanese language pattern match codes, refer to the Pattern Match Operator reference page.

Examples

The following example returns the half-with katakana characters “a”, “me”, “ri”, ka” (America):

  ZZDUMP $CHAR(65383,65426,65432,65398)

The following example converts these half-with katakana characters to the corresponding full-width katakana characters:

  ZZDUMP $ZZENKAKU($CHAR(65383,65426,65432,65398),1)

The following examples both convert these half-with katakana characters to the corresponding full-width hiragana characters. Note that $ZZENKAKU converts from katakana to hiragana by default:

  ZZDUMP $ZZENKAKU($CHAR(65383,65426,65432,65398),0)
  ZZDUMP $ZZENKAKU($CHAR(65383,65426,65432,65398))

See Also

FeedbackOpens in a new tab