JMP specifically initializes Python as UTF-8. You can try the standard Python mechanism for specifying the encoding of the Python source, by a 'magic comment' in the source. However, since JMP initializes Python only once per run of JMP I'm not sure that this technique below will work. If it does work, it would have to be the very first script run, but even that may be too late as JMP internally runs some small Python scripts to set up the environment.
See: https://peps.python.org/pep-0263/
Python will default to ASCII as standard encoding if no other encoding hints are given.
To define a source code encoding, a magic comment must be placed into the source files either as first or second line in the file, such as:
or (using formats recognized by popular editors):
#!/usr/bin/python
# -*- coding: <encoding name> -*-
or:
#!/usr/bin/python
# vim: set fileencoding=<encoding name> :
More precisely, the first or second line must match the following regular expression:
^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)
If this does not solve the issue, please contact JMP Technical Support and file a bug report. I will ask our testing team to check out variations where JMP encoding used is not UTF-8.