Skip to main content

I have a unicode string that looks like:

Lat: 49° 16.578', Lng: -123° 7.3'

In a standalone Python script I can find the unicode characters by putting this at the top of my script:

# -*- coding: utf-8 -*-

However, this doesn't work in the PythonCaller. Is there a way to do this?

Maybe not the answer you're looking for, but switch your workspace to use Python 3 if you can. Unicode is much, much simpler then.


Hi, try this when you print the string text.encode('utf-8')


Hi, try this when you print the string text.encode('utf-8')

No, I get: 'ascii' codec can't decode byte 0xc2 in position 7: ordinal not in range(128)

 


Maybe not the answer you're looking for, but switch your workspace to use Python 3 if you can. Unicode is much, much simpler then.

Looks like Python 3 is going to do it. No conversion needed, it just understands the unicode characters.


Reply