Unable to get Chinese characters in Ignition

I tried by printing Chinese language in script console and its print expected which is mentioned in Screenshot 1.

And I am getting problem in getting Chinese words by using API please go through Screenshot 2 for more details.


Screenshot 1:

Screenshot 2:


  1.  Function called in script console.
  2. Getting this font while getting using api where I expected the correct Chinese words.

  3. API path.

  4. Returning Data from function executed.

Please help me into this.

I am waiting for your positive response.
Thanks and regards,
Omkar Dengle

It's python2, use u before str, like u'测试'.
By the way, if you want edit incoming parameters, u'{}'.format() is a good choice.


Or avoid python libraries like urllib and requests. Use native java methods instead. Also, use system.net.httpClient() instead of httpGet(), as it has more modern encoding support.

1 Like