osx - Decoding Mac OS text in Python -
I am writing some code to parse RTF documents, and handle different codepages that use them. Python comes with decoders for all the necessary Windows codepages, but I'm not sure how to manage Mac:
# 77: "10000", #Mac Roman # 78: " 10001 ", # Mike Shift # 79:" 10003 ", #Make Hangul # 80:" 10008 ", #Mac GB2312 # 81:" 10002 ", #Make Big 5 # 83:" 10005 ", #Mac Hebrew # 84: "10004" Mac Arabic # 85: "10006", #Mac Greek # 86: "10081", #Mac Turkey # 87: "10021", #Mac Thai # 88: "10029", #Make East Europe # 89 : 10007 ", #MAC Russian
For any of these built-in summer python If not, then is there a cross-platform pure-Python library that will handle them?
You can use these for the Python codecs, whose names are known as 'Mac-Roman', 'Mac-Turkey', etc.
& gt; & gt; & Gt; 'Foo'.decode (' mac-turkish ') u'foo'
You have to refer to them by their names, you will find these questions in your question. T source files appear in the $ pylib / encodings / mac_ * for more information. View on Py
Comments
Post a Comment