CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2013
    Posts
    44

    utf8 compilation error

    Hi !

    I use Qt 5.1.1 with Visual Studio 2012.

    I declare:

    Code:
    struct Alpha {
          const char* text_1;  
          const char* text_2;  
          };
    And:

    Code:
    static Alpha aAlpha[] = {
    
          {  "cat", ""                                                       },
          {  "dog", u8"\U0001d18f\U0001d18f\U0001d18f\U0001d18f\U0001d18f\U0001d18f" },
          };
    I have got many warning & errors :

    E:\animal.cpp:45: warning: C4566: character represented by universal-character-name '\UD834DD8F' cannot be represented in the current code page (1252)
    E:\animal.cpp:45: error: C2065: 'u8' : undeclared identifier

    Could you help please ?

  2. #2
    Join Date
    Jan 2013
    Posts
    44

    Re: utf8 compilation error

    VS 2012 does not understand the prefix "u8".
    I used the hex escape. I mean I replaced \U0001d18f with the hex sequence \xf0\x9d\x86\x8f and deleted the prefix u8 in front of the string.
    Is that correct ?

  3. #3
    Join Date
    Nov 2003
    Posts
    1,902

    Re: utf8 compilation error

    >>Is that correct ?
    That is the best you can do with no support for "u8".

    gg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured