Unicode characters Issue?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/08/2011 at 14:20, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R9.6+ 
    Platform:   Windows  ; Mac  ;  Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Howdy,

    I'm using the unicode encoding "\u00A9" to display the copyright symbol in a dialog but it's actually displaying "©" instead.

    The same thing with using "\u00AE" for the  registered trademark (circle R), it's actually displaying "®" instead.

    Is it a bug or should I not be using unicode?

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/08/2011 at 08:28, xxxxxxxx wrote:

    Since nobody is replying. I'll just say this:
    -I'm using the R12 Demo on a PC and they they all seem work properly for me.
    -Lennart is using R12 and a Mac. And from what I've seen from him they all seem to work properly.

    So It might only be a problem with older versions.
    You'd probably have to ask people with various older versions to test it for you to figure out which ones do and don't work.

    -ScottA



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 18/08/2011 at 08:44, xxxxxxxx wrote:

    Howdy,

    Oh, I found the answer. It works fine as long as you're using it in .str file and using GeLoadString() to load the string from the file.

    But, it does not work on Mac when trying to embed the string in the code itself. 
    For example, using it like this:

    SetString(ID_MY_COPYRIGHT_STRING,"\u00A9 2011 by Me");
    

    ... does not work on Mac, but does work on PC.

    So, the simple solution was to do something like this:

    ID_COPYRIGHT_SYMBOL               "\u00A9";
    

    ... in a .str file, and then use it like this:

    SetString(ID_MY_COPYRIGHT_STRING,GeLoadString(ID_COPYRIGHT_SYMBOL)+" 2011 by Me");
    

    ... in the source file.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 22/08/2011 at 08:01, xxxxxxxx wrote:

    I can confirm this for OSX. It's working fine under Windows though. I will report this.

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 22/08/2011 at 09:05, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Howdy,
    Oh, I found the answer. It works fine as long as you're using it in .str file and using GeLoadString() to load the string from the file.
    But, it does not work on Mac when trying to embed the string in the code itself. 
    For example, using it like this:

    [/DIV][DIV]SetString(ID_MY_COPYRIGHT_STRING,"\u00A9 2011 by Me");[/DIV][DIV]
    

    ... does not work on Mac, but does work on PC.
    So, the simple solution was to do something like this:

    [/DIV][DIV]ID_COPYRIGHT_SYMBOL               "\u00A9";[/DIV][DIV]
    

    ... in a .str file, and then use it like this:

    [/DIV][DIV]SetString(ID_MY_COPYRIGHT_STRING,GeLoadString(ID_COPYRIGHT_SYMBOL)+" 2011 by Me");[/DIV][DIV]
    

    ... in the source file.
    Adios,
    Cactus Dan

    If memory of the C/C++ standard serves me right, you're not using a valid method to specify a string literal (or constant). See here for valid characters to be used in for char escaping:

    http://msdn.microsoft.com/de-de/library/6aw8xdf2.aspx
    http://msdn.microsoft.com/en-us/library/69ze775t(v=VS.100).aspx

    There once was a C++0x proposal to allow entering unicode literals in a similar way you did it, but that was rejected by the standards commission (unfortunately...). Therefore the result (created by the compiler) of your string isn't specified.

    Best regards,

    Wilfried



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 22/08/2011 at 10:16, xxxxxxxx wrote:

    Howdy,

    Thanks for the additional information. Wink

    By the way, since MSVC can handle the "\u" in the source code and Xcode can handle the standard Option Key+ designations in the source code, this may also be an alternative solution:

    #ifdef __PC
    	String cSymbol = "\u00A9";
    	String rSymbol = "\u00AE";
    #else
    	String cSymbol = "©";
    	String rSymbol = "®";
    #endif
    

    Adios,
    Cactus Dan


Log in to reply