Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with non-ascii character support: non-ascii characters stop script and give a misleading error message, no non-ascii support in console #389

Open
hjhilden opened this issue Aug 3, 2024 · 1 comment

Comments

@hjhilden
Copy link

hjhilden commented Aug 3, 2024

If you input something like this in the IDE, the script will halt with a misleading error message about a missing parenthesis:

metsäkanat = 2000
print(metsäkanat)
image

Additionally, if you print a string with non-ascii characters, the console displays them wrongly:

print('Bösendorfer')
Bösendorfer

Tested on MacOS Monterey 12.5, Processing 4.3

@villares
Copy link

villares commented Aug 3, 2024

Cheers, @hjhilden !

Processing Python mode is based on Python 2 that can't handle non-ascii identifiers (names for variables, functions and etc.).

But you can have Unicode strings using the u prefix like this: print(u'Bösendorfer') .

I must warn you that Python mode is very precarious on Processing 4.X, it will mostly fail silently, unable to offer even the basic error messages, like NameError or TypeError. If you really want to use it, stick to Processing 3.5.4.

You could try https://py5coding.org, an actively maintained Python + Processing framework that that is based on Python 3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants