Closed miek770 closed 5 years ago
Well, that's a question for the script author I suppose, but I expect the problem is rooted in a mismatch of the default unicode encoding.
python-pptx
uses UTF-8, and it looks like your default encoding is CP1252 (Windows).
Maybe print([encode(run, "UTF-8") for run in text_runs])
will work, but that's just an educated guess. print()
outputs bytes, and text_runs
looks like a list of str
, which in Python3 is unicode.
In any case, there's no evidence that python-pptx
isn't behaving as expected.
Btw, support questions like this are best asked on StackOverflow, using the "python-pptx" tag. They get more attention there and don't clog up the issues list.
Indeed, this worked: print([run.encode("UTF-8") for run in text_runs])
. Thank you.
Glad you got it working :)
Hi,
I followed these steps to handle a powerpoint file in Git: https://www.ficonsulting.com/filabs/MSOfficeGit
When using
git diff
after having modified an MS Office 365 ProPlus powerpoint file, I get the following error:It appears to be related to #139, but I'm using version 0.6.17 of
python-pptx
, installed from PyPI.I'm running git bash in mintty 2.6.2 (x86_64-pc-msys).
The offending character '\u221a' appears to be a square root.
Apart from the powerpoint file itself, would you need additional information to point me in the right direction? Should I use another terminal?
Thank you,
Michel