Unicode literal usage rules - Connect_CDC - connect_cdc_mimix_share - Latest

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
Latest
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
ft:lastEdition
2024-08-20
ft:lastPublication
2024-08-20T21:40:14.000381

The following rules apply to Unicode literals.

  • Unicode literals are treated as a sub-type of a character literal when used in expressions.

  • Unicode literals require single quotes. This is also a requirement for any character literal.

  • For Unicode literals, each Unicode character must begin with a single back slash followed by the small letter "u" and exactly 4 valid hexadecimal digits. The 4 digits taken together can represent any Unicode character from \u0000 to \uFFFF.

  • A Unicode literal must only contain Unicode escaped characters.

  • A Unicode literal cannot contain any of the other allowed escaped characters.

  • A character literal cannot contain a mixture of Unicode and non-Unicode characters.

Note: Precisely uses the standard Java convention to represent a Unicode character. This is because when you construct an escape sequence of characters in a Java string ("\uxxxx" where xxxx is some hexadecimal number), and the expression is generated, the compiler automatically generates the appropriate Unicode characters in the string.