Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:07:02+00:00 2026-05-26T01:07:02+00:00

C++11 introduces a new set of string literal prefixes (and even allows user-defined suffixes).

  • 0

C++11 introduces a new set of string literal prefixes (and even allows user-defined suffixes). On top of this, you can directly use Unicode escape sequences to code a certain symbol without having to worry about encoding.

const char16_t* s16 = u"\u00DA";
const char32_t* s32 = U"\u00DA";

But can I use the unicode escape sequences in wchar_t string literals as well? It would seem to be a defect if this wasn’t possible.

const wchar_t* sw = L"\u00DA";

The integer value of sw[0] would of course depend on what wchar_t is on a particular platform, but to all other effects, this should be portable, no?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:07:03+00:00Added an answer on May 26, 2026 at 1:07 am

    It would work, but it may not have the desired semantics. \u00DA will expand into as many target characters as necessary for UTF8/16/32 encoding, depending on the size of wchar_t, but bear in mind that wide strings do not have any documented, guaranteed encoding semantics — they’re simply “the system’s encoding”, with no attempt made to say what that is, or require the user to know what that is.

    So it’s best not to mix and match. Use either one, but not both, of the two:

    1. system-specific: char*/"", wchar_t*/L"", \x-literals, mbstowcs/wcstombs

    2. Unicode: char*/u8"", char16_t*/u"", char32_t*/U"", \u/\U literals.

    (Here are some related questions of mine on the subject.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

C++11 introduces a new way of finishing program execution— std::quick_exit . Quoting the N3242
Every new generation of CPU introduces some sets of new instructions, i.e. MMX, 3DNOW,
I have an interface like so: Interface IWriteFile { string FileName {get;set;} void Open();
I have this API function: public ResultEnum DoSomeAction(string a, string b, DateTime c, OtherEnum
This is really frustrating me. I'm new to C Sharp so looking for some
I'm using the new ViewPager -view from the Android compatibility library, and I can't
Microsoft introduced a new System.IO.MemoryMappedFiles namespace in .Net 4. Does anyone know if it
C# 4.0 introduced a new type called 'dynamic'. It all sounds good, but what
Google Chrome 17 introduced a new feature which preloads a webpage to improve rendering
As you know HTML5 introduced some new html tag, like footer,header, ... What prevent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.