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 6358367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:21:39+00:00 2026-05-24T23:21:39+00:00

Can anyone explain why universal character literals (eg \u00b1) are being encoded into char

  • 0

Can anyone explain why universal character literals (eg “\u00b1”) are being encoded into char strings as UTF-8? Why does the following print the plus/minus symbol?

#include <iostream>
#include <cstring>
int main()
{
  std::cout << "\u00b1" << std::endl;
  return 0;
}

Is this related to my current locale?

  • 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-24T23:21:40+00:00Added an answer on May 24, 2026 at 11:21 pm

    2.13.2. […]

    5/ A universal-character-name is translated to the encoding, in
    the execution character set, of the character named. If there is no
    such encoding, the universal-character-name is translated to an
    implementation defined encoding. [Note: in translation phase 1, a
    universal-character-name is introduced whenever an actual extended
    character is encountered in the source text. Therefore, all extended
    characters are described in terms of universal-character-names.
    However, the actual compiler implementation may use its own native
    character set, so long as the same results are obtained. ]

    and

    2.2. […] The values of the members of the execution character sets
    are implementation-defined, and any additional members are
    locale-specific.

    In short, the answer to your question is in your compiler documentation. However:

    2.2. 2/ The character designated by the universal-character-name
    \UNNNNNNNN is that character whose character short name in ISO/IEC
    10646 is NNNNNNNN; the character designated by the
    universal-character-name \uNNNN is that character whose character
    short name in ISO/IEC 10646 is 0000NNNN. If the hexadecimal value for
    a universal character name is less than 0x20 or in the range 0x7F-0x9F
    (inclusive), or if the universal character name designates a character
    in the basic source character set, then the program is illformed.

    so you are guaranteed that the character you name is translated into an implementation defined encoding, possibly locale specific.

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

Sidebar

Related Questions

Can anyone explain to me what does the following Ruby code do? VARIABLE.scan /\((.+)\)$/
Can anyone explain why following code won't compile? At least on g++ 4.2.4. And
Can anyone explain the following immediate window behavior: Debug.Print mDb.DatabaseOptions Method arguments must be
can anyone explain to me, why i am not allowed to do the following?
Can anyone explain to me why this code below does not work? #include opencv/cv.h
Can anyone explain this to me , String str = Hello; str += ((char)97)
Can anyone explain why the following happens in R: > 0.0 < 14.9a [1]
Can anyone explain me what is a difference between these lines of code char
Can anyone explain why I get the following errors when compiling the code shown
Can anyone explain to me how to pass multiple values into a parameter or

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.