【发布时间】:2012-11-05 13:48:19
【问题描述】:
我有两个 unicode 字符串 '가' 和 'ㄱ',我想将它们连接起来得到 "가ㄱ"
这是我的代码:
output1 = unicodeQueue(self.queue) # first unicode result
output2 = unicodeQueue(self.bufferQueue) # second unicode result
sequence = [output1, output2]
print sequence
output = ''.join(sequence)
return output
这是我得到的输出:
[u'\uac00', u'\u3131']
ㄱ가가ㄱ가
我不知道为什么它没有产生正确的结果,谁能帮我解决这个问题?
【问题讨论】:
-
我无法重现此内容。
-
@NPE 我上传了我的部分脚本,我的主要问题是“如何在 python 中连接两个 unicode?”
-
@user1732445:您的代码没有明显错误。
-
为我工作。可以试试
u''.join(sequence)。 -
@KennyTM 嗯。谢谢..现在它对我有用...
标签: python unicode python-2.x