<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Rename Layers with Python containing Emoji?]]></title><description><![CDATA[<pre><code>import c4d

doc: c4d.documents.BaseDocument  # The currently active document.
op: c4d.BaseObject | None  # The primary selected object in `doc`. Can be `None`.

def create_and_rename_layer(doc, layer_name):
    new_layer = c4d.documents.LayerObject()
    new_layer.SetName(layer_name)
    root_layer = doc.GetLayerObjectRoot()
    new_layer.InsertUnderLast(root_layer)
    c4d.EventAdd()
    return new_layer

def main() -&gt; None:
    layer_1_string = "Layer 1: \N{grinning face with smiling eyes}"
    print(layer_1_string)
    layer_1 = create_and_rename_layer(doc, layer_1_string)

    layer_2_string = "Layer 2: \U0001F600"
    print(layer_2_string)
    layer_2 = create_and_rename_layer(doc, layer_2_string)

    layer_3_string = "Layer 3: 🤣"
    print(layer_3_string)
    layer_3 = create_and_rename_layer(doc, layer_3_string)


if __name__ == '__main__':
    main() 
</code></pre>
<p dir="auto">I've the code above, with which I try to create and rename layers, so they contain lovely Emoji. Though when I execute the code, I see the Emoji in the Console, but  the layers refuse to rename accordingly.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1709476509558-cinema_4d-2024-03-03-um-15.34.56.png" alt="Cinema_4D  2024-03-03 um 15.34.56.png" class=" img-fluid img-markdown" /> <img src="/forum/assets/uploads/files/1709476509569-cinema_4d-2024-03-03-um-15.35.00.png" alt="Cinema_4D  2024-03-03 um 15.35.00.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">When I edit a layer by hand, I can input Emoji with no issues:</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1709476583992-60812c8a-6f62-490d-b6f7-036e7d839f1c-image.png" alt="60812c8a-6f62-490d-b6f7-036e7d839f1c-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>http://developers.maxon.net/forum/topic/15416/rename-layers-with-python-containing-emoji</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 01:50:18 GMT</lastBuildDate><atom:link href="http://developers.maxon.net/forum/topic/15416.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Mar 2024 14:33:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Rename Layers with Python containing Emoji? on Mon, 04 Mar 2024 15:00:32 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/gaschka">@<bdi>gaschka</bdi></a>,</p>
<p dir="auto">Thank you for reaching out to us. Yes, this is an encoding issue. In general, Unicode is supported by the Python to C++ bindings, as you can see, French, German, and Turkish diacritics are all correctly transported, as well as Chinese characters.</p>
<p dir="auto"><img src="/forum/assets/uploads/files/1709563393413-5bfdbc74-f638-4fd8-8df9-2b95479b233b-image.png" alt="5bfdbc74-f638-4fd8-8df9-2b95479b233b-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">But all these are part of the Basic Multilingual Plane (BMP) while the emojis are part of the Supplementary Multilingual Plane (SMP) of the Unicode table. It could either be that there is something not implemented or some bits get chopped off while data is sent to the C++ layer. I don't really know, the person who is responsible for the Python bindings, <a class="plugin-mentions-user plugin-mentions-a" href="/forum/user/m_adam">@<bdi>m_adam</bdi></a>, is on vacation. I will ask him once he is back, as I too would be guessing what is happening here exactly.</p>
<p dir="auto">Cheers,<br />
Ferdinand</p>
]]></description><link>http://developers.maxon.net/forum/post/73914</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73914</guid><dc:creator><![CDATA[ferdinand]]></dc:creator><pubDate>Mon, 04 Mar 2024 15:00:32 GMT</pubDate></item><item><title><![CDATA[Reply to Rename Layers with Python containing Emoji? on Mon, 04 Mar 2024 09:22:01 GMT]]></title><description><![CDATA[<p dir="auto">The same is true, trying to rename objects in the OM: It works manually, but not via script. Is it an encoding issue?</p>
]]></description><link>http://developers.maxon.net/forum/post/73909</link><guid isPermaLink="true">http://developers.maxon.net/forum/post/73909</guid><dc:creator><![CDATA[gaschka]]></dc:creator><pubDate>Mon, 04 Mar 2024 09:22:01 GMT</pubDate></item></channel></rss>