Sun Studio 12: C++ User's Guide

A.2.180.1 Values

Specify -xustr=ascii_utf16_ushort if you need to support an internationalized application that uses ISO10646 UTF-16 string literals. You can turn off compiler recognition of U"ASCII_string" string literals by specifying -xustr=no. The right-most instance of this option on the command line overrides all previous instances.

You can specify -xustr=ascii_ustf16_ushort without also specifying a U"ASCII_string" string literal. It is not an error to do so.

Defaults

The default is -xustr=no. If you specify -xustr without an argument, the compiler won’t accept it and instead issues a warning. The default can change if the C or C++ standards define a meaning for the syntax.

Example

The following example shows a string literal in quotes that is prepended by U. It also shows a command line that specifies -xustr


example% cat file.cc
const unsigned short *foo = U"foo";
const unsigned short bar[] = U"bar";
const unsigned short *fun() {return U"fun"};
example% CC -xustr=ascii_utf16_ushort file.cc -c

Warnings

Sixteen-bit character-literals are not supported.