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

    Using accent characters in script name and descrip

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 223 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 12/01/2015 at 08:07, xxxxxxxx wrote:

      Hi, I'm working on a user script in the script manager.
      My script is working perfectly but at the beginning I put this :

      """
      Invert Vertex Map
      v1.0

      Written for Cinema 4d R16.029

      Name-US:Invert Vertex Map
      Description-US:Inverts selected vertex maps
      Name-ES:Invertir Mapa de Vértices
      Description-ES:Invertir las mapas de vértices ya seleccionado
      """
      but wherever there is an accented character (the é in vertices), it displays wrong.

      I looked at the general python 2.6 help but I couldn't understand how to apply the syntax to a script, rather than an imported .py file.
      I couldn't work out where I should put #_*_ coding: utf-8,
      or even if that was the right approach.

      It's not too important for this example but I would really like to be able to include European language help in my scripts without having to make a command plugin.

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

        On 12/01/2015 at 14:12, xxxxxxxx wrote:

        OK, after some more research, I've solved this myself.

        The é was being replaced by é.

        It's something to do with string encoding but I couldn't work out which one Cinema's Python is using or how to change it.

        The solution was to use the Unicode \xe9 which is the code for é, where the \ in a string tells python to expect a special character defined with a Unicode.

        Maybe there's a simpler way to do this, I'm not sure. It could get annoying if you have to write a lot of accents.

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