On 10/05/2014 08:11, wxjmfa...@gmail.com wrote:
Anyway, as Python may fail as soon as one uses an EM DASH or an EM DASH, I think it's not worth the effort to spend to much time with it.
Nope -- seems all right to me. (Hopefully helping the OP out as well as rebutting a rather foolish assertion).
<code> #!python3.4 import win32com.client import unicodedata word = win32com.client.gencache.EnsureDispatch("Word.Application") try: doc1 = word.Documents.Add() doc1.Range().Text += "Hello \u2014 World" doc1.SaveAs(r"c:\temp\em_dash.docx") doc1.Close() doc2 = win32com.client.GetObject(r"c:\temp\em_dash.docx") for uchar in doc2.Range().Text.strip(): print(unicodedata.name(uchar)) finally: word.Quit() </code> TJG -- https://mail.python.org/mailman/listinfo/python-list