Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 435
unj2 Avatar asked Jun 17 '12 19:06

unj2


1 Answers

A universal character name looks like \uFFFD 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.

like image 105
bames53 Avatar answered Sep 30 '22 23:09

bames53