作者:Panzerkampfwagen-VI_238 | 来源:互联网 | 2023-06-17 11:43
I've been trying to output
as '\U0001f604' instead of the smiley but it doesn't seem to work.
我一直在尝试输出'\U0001f604'而不是笑脸,但似乎不起作用。
i tried using repr() but it gives me this '\xf0\x9f\x98\x84'. Currently it outputs as the smiley which is not what I wanted. encode('unicode_escape') gives me a UnicodeDecodeError.
我尝试使用repr(),但是它给了我这个'\xf0\x9f\x98\x84'。目前它输出的笑脸不是我想要的。encode(“unicode_escape”)给我一个UnicodeDecodeError。
The smiley was passed as a string to a class method in python. i.e. "I am happy
"
smiley作为字符串传递给python中的类方法。即。“我很高兴”
Appreciate if anyone could help.
如果有人能帮忙,请感激。
Sorry for the big smiley. The markdown doesn't seem to work here.
为那个大笑脸道歉。降价似乎在这里行不通。
4 个解决方案