Fail on Unicode
Posted: 19.11.2015 10:31
An annoying issue I'm having with unicode characters is not being able to use them. I can't print them to system journal, nor can I print them in game even if UO can handle them. I have seen in the Russian forums that this has been an issue for a few people already in the Asian community, and I was not able to figure out whether it was addressed. It seems that, when stealth attempts to use what's passed into the functions UOSay or AddToSystemJournal, it attempts to encode it using ASCII. When that fails, it either causes stealth to crash or complain.
I believe this issue may also shed some light on PartySay and how it is horribly mangled. Instead of using ASCII, it seems to want to encode the passed string as something completely different which causes it to bug out. I'll have to investigate it further and make a post specifically about that though.
This is the code I'm using:
This is the error I'm getting:
I believe this issue may also shed some light on PartySay and how it is horribly mangled. Instead of using ASCII, it seems to want to encode the passed string as something completely different which causes it to bug out. I'll have to investigate it further and make a post specifically about that though.
This is the code I'm using:
Code: Select all
import stealth
stealth.UOSay(u'\u2660')
Code: Select all
(file path) line 3, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2660' in position 0: ordinal not in range(128)