Punkfloyd
Punkfloyd

Reputation: 45

Use literals strings with ICU

I'm wondering if there's a way to use literal strings with ICU, I currently use wide character literal string like this:

u_strcpy( catColor, L"Yellow0" );

if (u_strcmp( catcolor, L"Yellow0" ) != 0)
    CatColorIsYellow();

I've heard about UNICODE_STRING but the result looks the same than with L""

Upvotes: 0

Views: 336

Answers (1)

NuSkooler
NuSkooler

Reputation: 5525

I'm unclear what you're asking about, but it appears you mean declaring them? In that case, see the UNICODE_STRING_SIMPLE macro:

const UnicodeString someString = UNICODE_STRING_SIMPLE("Some String");

If you're looking to declare C style Unicode string literal, take a look at the U_STRING_DECL and U_STRING_INIT macros.

See also: C++ Unicode String Literals

Upvotes: 1

Related Questions