home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,372 of 33,346   
   Johannes Schaub (litb) to All   
   Why does stringizing an UCN not produce    
   24 Jun 11 01:27:31   
   
   From: schaub.johannes@googlemail.com   
      
   The FDIS says that at phase 1 of compilation   
      
   Any source file character not in the basic source character set (2.3) is   
   replaced by the universal-character-name that designates that character.   
      
   And at phase 4 it says   
      
   Preprocessing directives are executed, macro invocations are expanded   
      
   At phase 5, we have   
      
   Each source character set member in a character literal or a string literal,   
   as well as each escape sequence and universal-character-name in a character   
   literal or a non-raw string literal, is converted to the corresponding   
   member of the execution character set   
      
   For the # operator, we have   
      
   a \ character is inserted before each " and \ character of a character   
   literal or string literal (including the delimiting " characters).   
      
   Hence I conducted the following test   
      
   #define GET_UCN(X) #X   
   GET_UCN("€")   
      
   With an input character set of UTF-8 (matching my file's encoding), I   
   expected the following preprocessing result of the #X operation:   
   "\"\\u20AC\"". GCC, Clang and boost.wave don't transform the € into a UCN   
   and instead yield "\"€\"". I feel like I'm missing something. Also, is the   
   spelling 20AC or 20ac? Or is this left unspecified? Can you please explain?   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca