Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Unicode文字に変換したいShift_JIS文字コード(整数)のリストがあります。chr()/unichr()他のエンコーディングで動作するバージョンの関数が必要だと思います。decode()と組み合わせて試しましhex()たが、16進値ではなく、文字列自体のみをデコードします。
chr()/unichr()
decode()
hex()
入力と出力の例:
input = [91, 92, 48, 528] output = ["[", "¥", "0", "0"]
誰か助けてもらえますか?前もって感謝します。
次のようなものから始めると:
bytearray = [65, 66, 67, 200, 156, 130]
次に、これはそれを行います:
>>> ustring = reduce(operator.add, map(chr, bytearray)).decode('shift_jis') >>> ustring u'ABC\uff88\u6029'