Scripting ascii vs unicode input

Previous topic - Next topic

apastuszak

I use a script written by a friend to make my life easier when designing stamp album pages.

He recently converted the script from Python 2 to Python 3 for use in Scribus 1.5.8 on Mac.

The script reads pipe delimited text out of text files and drops text into various text boxes it creates. The script works fine except when there are any unicode characters in the text, such as fractions the cent symbol or smart quotes. When that happens, I get this error:

Traceback (most recent call last):
  File "<string>", line 11, in <module>
  File "<string>", line 7185, in <module>
  File "<string>", line 710, in funcImportSettings
  File "<string>", line 715, in funcImportBatch
  File "/Applications/Scribus.app/Contents/Frameworks/Python.framework/Versions/3.9/lib/python3.9/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 2414: ordinal not in range(128)

The bolded part is what concerns me. I want to take a whack at trying to see if I can get this to work. I just want to know if the scripting environment supports unicode, or just ascii.