<?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[Scripting, strings and diacritics]]></title><description><![CDATA[<p dir="auto">I type this code in a script window:</p>
<pre><code class="language-python">Firsts = "F P T V"
Seconds = "à é ï ø û"
nalts = 10

for f in Firsts.split(" "):
    for s in Seconds.split(" "):
        print "%s%s " %(f, s) *nalts
</code></pre>
<p dir="auto">It runs and it works fine (print the expected output). When I try to save the script or RF crashes or I get this traceback:</p>
<pre><code class="language-console">Traceback (most recent call last):
  File "Combinations RF.py", line 10, in 
AttributeError: 'NoneType' object has no attribute 'selection'
Traceback (most recent call last):
  File "lib/scripting/pyDocument.pyc", line 37, in writeSafelyToURL_ofType_forSaveOperation_error_
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 106: ordinal not in range(128)
Traceback (most recent call last):
  File "lib/doodleDelegate.pyc", line 81, in sendEvent_
  File "lib/scripting/pyDocument.pyc", line 37, in writeSafelyToURL_ofType_forSaveOperation_error_
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 106: ordinal not in range(128)
</code></pre>
<p dir="auto">I guess it has to do with "à é ï ø û".<br />
When I save the code in Textmate, "à é ï ø û" get changed in the script for  "Ã  Ã© Ã¯ Ã¸ Ã»".</p>
<p dir="auto">I even tried using<code> "# -*- coding: utf-8 -*-"</code> as first line of code but didn't work.<br />
Might it be a Python bug? I've been trying to deal with this for a while and it's a headache.</p>
<p dir="auto">BTW, is there a way of getting "à" as output from "agrave"?<br />
In some way RF does it in the Space Center window.</p>
<p dir="auto">Thanks as always,</p>
<p dir="auto">Jca</p>
]]></description><link>https://forum.robofont.com/topic/137/scripting-strings-and-diacritics</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 05:51:45 GMT</lastBuildDate><atom:link href="https://forum.robofont.com/topic/137.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Jun 2012 08:21:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Scripting, strings and diacritics on Mon, 01 Jan 2018 02:07:53 GMT]]></title><description><![CDATA[<p dir="auto">I type this code in a script window:</p>
<pre><code class="language-python">Firsts = "F P T V"
Seconds = "à é ï ø û"
nalts = 10

for f in Firsts.split(" "):
    for s in Seconds.split(" "):
        print "%s%s " %(f, s) *nalts
</code></pre>
<p dir="auto">It runs and it works fine (print the expected output). When I try to save the script or RF crashes or I get this traceback:</p>
<pre><code class="language-console">Traceback (most recent call last):
  File "Combinations RF.py", line 10, in 
AttributeError: 'NoneType' object has no attribute 'selection'
Traceback (most recent call last):
  File "lib/scripting/pyDocument.pyc", line 37, in writeSafelyToURL_ofType_forSaveOperation_error_
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 106: ordinal not in range(128)
Traceback (most recent call last):
  File "lib/doodleDelegate.pyc", line 81, in sendEvent_
  File "lib/scripting/pyDocument.pyc", line 37, in writeSafelyToURL_ofType_forSaveOperation_error_
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 106: ordinal not in range(128)
</code></pre>
<p dir="auto">I guess it has to do with "à é ï ø û".<br />
When I save the code in Textmate, "à é ï ø û" get changed in the script for  "Ã  Ã© Ã¯ Ã¸ Ã»".</p>
<p dir="auto">I even tried using<code> "# -*- coding: utf-8 -*-"</code> as first line of code but didn't work.<br />
Might it be a Python bug? I've been trying to deal with this for a while and it's a headache.</p>
<p dir="auto">BTW, is there a way of getting "à" as output from "agrave"?<br />
In some way RF does it in the Space Center window.</p>
<p dir="auto">Thanks as always,</p>
<p dir="auto">Jca</p>
]]></description><link>https://forum.robofont.com/post/137</link><guid isPermaLink="true">https://forum.robofont.com/post/137</guid><dc:creator><![CDATA[joanca]]></dc:creator><pubDate>Mon, 01 Jan 2018 02:07:53 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting, strings and diacritics on Mon, 04 Jun 2012 09:13:27 GMT]]></title><description><![CDATA[<p dir="auto">I hope somebody will post a more elaborate answer but I think you should convert the non ascii characters so python can read them.</p>
<p dir="auto">Seconds = u"\u00E0  \u00E9 \u00EF \u00F8 \u00FB"</p>
]]></description><link>https://forum.robofont.com/post/746</link><guid isPermaLink="true">https://forum.robofont.com/post/746</guid><dc:creator><![CDATA[jo]]></dc:creator><pubDate>Mon, 04 Jun 2012 09:13:27 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting, strings and diacritics on Mon, 04 Jun 2012 09:33:35 GMT]]></title><description><![CDATA[<p dir="auto">Thanks jo! with this info I'll manage I guess.<br />
At this point something that just works it's perfect, the dark magic in the insides is not important now. I'll check later.</p>
]]></description><link>https://forum.robofont.com/post/747</link><guid isPermaLink="true">https://forum.robofont.com/post/747</guid><dc:creator><![CDATA[joanca]]></dc:creator><pubDate>Mon, 04 Jun 2012 09:33:35 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting, strings and diacritics on Mon, 04 Jun 2012 10:23:20 GMT]]></title><description><![CDATA[<p dir="auto">This is idd a bug :) and already solved in the beta and will be fixed in the next release.</p>
]]></description><link>https://forum.robofont.com/post/749</link><guid isPermaLink="true">https://forum.robofont.com/post/749</guid><dc:creator><![CDATA[frederik]]></dc:creator><pubDate>Mon, 04 Jun 2012 10:23:20 GMT</pubDate></item><item><title><![CDATA[Reply to Scripting, strings and diacritics on Mon, 04 Jun 2012 10:57:41 GMT]]></title><description><![CDATA[<p dir="auto">dank u Frederik</p>
]]></description><link>https://forum.robofont.com/post/750</link><guid isPermaLink="true">https://forum.robofont.com/post/750</guid><dc:creator><![CDATA[joanca]]></dc:creator><pubDate>Mon, 04 Jun 2012 10:57:41 GMT</pubDate></item></channel></rss>