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

    R12 str encoding issue

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 282 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

      On 08/07/2013 at 22:45, xxxxxxxx wrote:

      Hi,

      I have the strange issue with non EN C4D version.

      Lets say, my C4D R12 is in the RU version and I have one multi-pass.

      The code:

      import c4d, os
      doc = c4d.documents.GetActiveDocument()
      rd = doc.GetActiveRenderData()
      mp = rd.GetFirstMultipass()
      name = mp.GetName()
      print type(name), name
      os.makedirs(os.path.join("/Users/Simukas/Desktop/TEST/", name))
      

      prints

      <type 'str'> Глубина
      

      but the folder will be created with very strange name

      \u0413\u043B\u0443\u0431\u0438\u043D\u0430
      

      Explaining image is here.

      This issue applies only to R12 and only if C4D interface language is not EN.

      Thanks for any comments in advance,
      Simonas

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

        On 08/07/2013 at 23:42, xxxxxxxx wrote:

        \u0413\u043B\u0443\u0431\u0438\u043D\u0430 is the unicode hex repr of Глубина. it seems that 
        there is something going wrong with the unicode encoding in python. c4d should not have any 
        influence by your code example, as the error occurs for os.makedirs(). the only thing i could think
        of is that c4d language setting is somehow reflected in the environment variable of the c4d python 
        instance which again does influence python's unicode parsing. also building the path string manually
        might help (don't use os.path, use the raw string, enforce unicodedata encoding).

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

          On 09/07/2013 at 00:04, xxxxxxxx wrote:

          ok... thanks, I'll check this latter 🙂

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