I am trying to return a non-ASCII character (for example é) from a Python shell script.
Dim s As String s = myShell.Result MsgBox(s)
The Python script itself for this simple example is just
someChar = 'e' print(someChar)
The print command in Python should put the string variable someChar into the output buffer.
The command s = myShell.Result in Xojo should put the output buffer into s.
This works fine.
s gets assigned "e"
But if someChar is not in the ASCII range I get an error.
someChar = 'é' print(someChar)
for s I get an error code.
-- UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 0: ordinal not in range(128)--
The error message shows that it has "gotten" the é in some sense because
u'\xe9' is a Unicode string that contains the unicode character U+00E9 (LATIN SMALL LETTER E WITH ACUTE).
I have tried in vain (I still get the error)
s = myShell.Result.ConvertEncoding(Encodings.UTF8)
Is there a way to return a character like é from a Shell script that is called from Xojo?