Sun Studio 12 Update 1: C++ User's Guide

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 foo;}
example% CC -xustr=ascii_utf16_ushort file.cc -c

An 8-bit character literal can be prepended with U to form a 16-bit UTF-16 character of type unsigned short. Examples:


const unsigned short x = U'x';    
const unsigned short y = U'\x79';