简体   繁体   中英

What does “Universal character name conversion” mean in C++?

C++98 apparently has this as one of the standards for compilation phases. What does it mean and why is it executed initially?

A universal character name looks like \� or \\U0010FFFD . It's a method of writing a character in your source code where the source code encoding does not include that character.

C++ specifies that characters not in the basic source character set be transformed into universal character names in the first phase of translation. The reason for this is so that universal character names and characters which are not in the basic source character set but which are in the source character set get treated identically.

The as-if rule means that an implementation is not actually required to do this universal character name translation, as long as it treats extended characters written as universal character names identically with extended characters that appear literally in the source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM