I type this code in a script window:
Firsts = “F P T V”
Seconds = “à é ï ø û”
nalts = 10
for f in Firsts.split(” “):
for s in Seconds.split(” “):
print “%s%s ” %(f, s) *nalts
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:
“””
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)
“””
I guess it has to do with “à é ï ø û”.
When I save the code in Textmate, “à é ï ø û” get changed in the script for “à é ï ø û”.
I even tried using “# -*- coding: utf-8 -*-” as first line of code but didn’t work.
Might it be a Python bug? I’ve been trying to deal with this for a while and it’s a headache.
BTW, is there a way of getting “à” as output from “agrave”?
In some way RF does it in the Space Center window.
Thanks as always,
Jca