Can't run python script with special characters

I’m getting the following error when trying to run a python script:
“Load Python Script: Error loading Python script”

After some tests I figured out that I just get this error when I have special characters in the python script, like: ç, ó, é…
(important to note, the script runs ok outside UIPath!)

I know one option is using the “chr(?)” from them instead the writting it. But I’m from Brazil, and we have a lot those in the scripts, it would be a bad solution.
And there is no encoding option for it.

Any ideas how can I run scrips (inside UIPath) with those special characters in it?

1 Like

anybody pls?

Hello @LeoBuz

I didn’t dig into that but UiPath doesn’t handle very well the encoding. If your file is in UTF-8, UiPath will complain. For the moment, I’m keeping UiPath out of the equation.

Encoding into your python file in ASCII (your system encoding) with the proper shebang might help. Let your script read the strings from another file with the proper encoding. Hope this will help.

1 Like

@msan I quite sure it would work, but I shouldn’t change the original scripts. And doing it for a lot of files would became a nightmare for future changes.

For now I prefer to run the script using a .bat file and doing no changes in the script.

But I can’t believe UIPath can’t handle any other format of script but UTF-8… I still have hope there is a way!! lol

1 Like