I am hoping there is a simple fix that I just don’t know of for this: If I wanted to cast some funky characters (superscripts, symbols, etc…) to a str() inside a Grasshopper widget, is there a simple way to do that properly? When I try I seem to get an error:
Runtime error (DecoderFallbackException):
Unable to translate bytes [B0] at index 0 from specified code page to Unicode.
Traceback:
line 1, in script
thanks so much for the suggestions! Using the .decode() I was able to get it to avoid the error at least. Adding in errors=‘replace’ can at least get around the erroring.
oh - and Graham, in mine I can only set the input type hint - not on the output - maybe cus’ I’m still on the old Rhino/GH version? I have the input (_text_In) set to ‘No Type Hint’ in the example above.
I think I was able to get it to work now. I used the ‘latin1’ decoding to preserve that degree symbol (°). So just in case anyone else is running into a similar issue, I got it to function with: