Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Strings different betweenPC and Mac?

    Scheduled Pinned Locked Moved SDK Help
    7 Posts 0 Posters 557 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 25/11/2009 at 11:50, xxxxxxxx wrote:

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

      ---------
         Hi,

      just a small question... why does the following code work on PC, but not on Mac?

        
      String ReplaceStr(String Original, String Search, String Replacement)   
      // Replace a Substring in a String   
      {   
           String res = Original;   
           LONG i = 0;   
        
           while (res.FindFirst(Search, &i;, i)) {   
                res.Delete(i, Search.GetLength());   
                res.Insert(i, Replacement);   
           }   
        
           return res;   
      }   
        
      String ConvertHTMLchars(String tmpl)   
      // Substitute special characters by their HTML entities   
      {   
           String res = tmpl;   
        
           res = ReplaceStr(res, "ä", "& auml;");   
           res = ReplaceStr(res, "ö", "& ouml;");   
           res = ReplaceStr(res, "ü", "& uuml;");   
           res = ReplaceStr(res, "Ä", "& Auml;");   
           res = ReplaceStr(res, "Ö", "& Ouml;");   
           res = ReplaceStr(res, "Ü", "& Uuml;");   
           res = ReplaceStr(res, "ß", "& szlig;");   
           res = ReplaceStr(res, "€", "& euro;");   
           res = ReplaceStr(res, "é", "& eacute;");   
           res = ReplaceStr(res, "É", "& Eacute;");   
           res = ReplaceStr(res, "Ê", "& Ecirc;");   
           res = ReplaceStr(res, "ê", "& ecirc;");   
           res = ReplaceStr(res, "È", "& Egrave;");   
           res = ReplaceStr(res, "è", "& egrave;");   
           res = ReplaceStr(res, "Â", "& Acirc;");   
           res = ReplaceStr(res, "â", "& acirc;");   
           res = ReplaceStr(res, "À", "& Agrave;");   
           res = ReplaceStr(res, "à", "& agrave;");   
           res = ReplaceStr(res, "Å", "& Aring;");   
           res = ReplaceStr(res, "å", "& aring;");   
        
           return res;   
      }   
      

      On PC, the special characters are replaced by HTML entities. On Mac, nothing happens. Why?

      Cheers,
      Jack

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 25/11/2009 at 12:22, xxxxxxxx wrote:

        I editied the code, it didn't display correctly before.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 25/11/2009 at 12:55, xxxxxxxx wrote:

          Have you tried Unicode formatting instead ("\u0..." - "\u00a9" for the copyright symbol as you might encode it in your c4d_strings.str file)?  The fact that they display in your IDE just means that the font being used has Unicode characters in it.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 25/11/2009 at 14:18, xxxxxxxx wrote:

            Ha, that sounds perfectly reasonable.
            After encoding all the special chars to Unicode, it still works on PC... will see in a couple of minutes if it does so on the Mac, too 🙂

            Cheers,
            Jack

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

              On 25/11/2009 at 14:35, xxxxxxxx wrote:

              Hm, unfortunately it still does not work in Mac 😞
              But thanks any way for the input!

              Cheers,
              Jack

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

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

                On 25/11/2009 at 14:42, xxxxxxxx wrote:

                Hi Jack, I suggest you to convert the String with 'StringEncoding' to 'StHTML'. This should work fine. Good luck

                P.S: 'StHTML' might be not documentated(in R10), even available in the sources.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

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

                  On 25/11/2009 at 14:52, xxxxxxxx wrote:

                  Arrgh, I have always thought that was introduced with R11.
                  They could really have put that into the R10 SDK docs... 😉

                  Thanks a lot!

                  Greetings,
                  Jack

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post