13.1.4 wstrings
The wstring
data type represents a sequence of
wchar
, except the wide character NULL. The type
wstring
is similar to that of type string, except that
its element type is wchar
instead of
char
. The actual length of a wstring
is
set at run time and, if the bounded form is used, must be less than
or equal to the bound.
The syntax for defining a wstring
is:
<wide_string_type> ::= “wstring” “<” <positive_int_const> “>”
| “wstring
A code example for wstring
is:
CORBA::WString_var v_upper = CORBA::wstring_dup(wmixed);
wstring
types are built in types just like unsigned
long, char, string, double, etc. They can be used directly as
parameters, typedef'd, used to construct structs, sequences,
unions, arrays, and so forth.
Note:
Thewchar
and wstring
data types enable users to interact with computers in their native written language. Some languages, such as Japanese and Chinese, have thousands of unique characters. These character sets do not fit within a byte. A number of schemes have been used to support multi-byte character sets, but they have proved to be unwieldy to use. Wide characters and wide strings make it easier to interact with this kind of complexity.
Parent topic: Mappings