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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Single international character problem

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 296 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 05/04/2006 at 07:10, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.x 
      Platform:      Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Imagine I have the following string:

      var st="áéíóú";

      if I perform a println(st); I get:

      áéíóú

      Correct!! Now, if I do the following:

      println(st[2]);

      I get:

      237

      Ok, I have to convert it to a character, so I do the following:

      println(tostring(st[2],"c");

      but I get:

      Ì

      instead of "é". "Ì" was not even in the original string!!

      How can I get individual characters from inside a string, correctly evaluated? Thank you very much in advance for any solution.

      Rui Batista

      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 06/04/2006 at 12:53, xxxxxxxx wrote:

        Do:

            
            
            var st="áéíóú";  
            var i = 2-1;  
            println(strmid(st,i,1));
        

        Note that strings are of course 0-indexed as well as arrays in C.O.F.F.E.E.

        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 06/04/2006 at 16:43, xxxxxxxx wrote:

          Thank you, Mikael.
          The solution I found is not far from it. This is what I did:

            
          add_char(line,char)  
          {  
          if(char<127) line=stradd(line,tostring(char,"c"));  
          else  
          line=stradd(line,strmid("?áéíóúàèìòùÁÉÍÓÚÀÈÌÒÙãÃâÂêÊîÎôÔûÛçÇñÑäÄëËïÏöÖüÜ",strchr(" áéíóúàèìòùÁÉÍÓÚÀÈÌÒÙãÃâÂêÊîÎôÔûÛçÇñÑäÄëËïÏöÖüÜ",char),1));  
          }
          

          While calling this routine with add_char(&line;,char);

          Rui Batista

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