Created
November 11, 2016 12:52
-
-
Save butsugiri/0f702829e1d384e7116eee8481de8d1c to your computer and use it in GitHub Desktop.
shift_jisとヘッダーのエンコーディングに記述されたshift_jisなxmlファイルとうまくやる方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| text = open("00001.dict", encoding="shift-jis").read() | |
| tree = etree.fromstring(text.encode("shift-jis")) | |
| print(etree.tostring(tree, encoding="utf-8", xml_declaration=True, doctype="<!DOCTYPE gda>").decode("utf8")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment