Comments (11)
That's a good question - to which I don't know the answer. It looks to me like it's actually a problem in lxml - which python-pptx relies on (and hence md2pptx relies on).
I'd love to fix this - if it's possible (even if I would rely on you to test it).
Does anyone know how to get python-pptx or lxml to accept Chinese characters?
One possibility worth testing is whether entity references can be used to insert Chinese characters. That might provide a workaround - if it worked.
from md2pptx.
I'd be more than happy to help test it, I've tried generating slides with Chinese using python-pptx with good results and now wonder if the problem is with lxml.
from md2pptx.
Thanks for the offer to help - by testing. If python-pptx works it's either not a lxml problem or else it's the way md2pptx is directly using lxml.
What happens if you try encoding a string (a character or two) using entity references?
I'll note that md2pptx only uses lxml directly for fancy things - manipulating XML beyond what python-pptx does.
from md2pptx.
Looks like it's the string addFormattedText
passes to python-pptx that's the problem.
from md2pptx.
The above - from the python-pptx docs for adding text to a run - might have some bearing on the problem. Particularly the "assumed to be UTF-8" bit.
from md2pptx.
I wonder if making md2pptx UTF-16, instead of UTF-8, would help.
from md2pptx.
Now I'm confused. I have a UTF-8 file with the following in and md2pptx has no trouble with it:
### String Test
* ディアボリックラヴァーズ or バッテリ
* 已下架
* لحضور المؤتمر الدولي العاشر
* 类, 有 优 先 选 择 的 权 利
(Note the right to left arabic texton the third line.)
from md2pptx.
It's very strange indeed. I can't use the UTF-8 format, but try to use the GB2312 format and it generates text with Chinese characters.
from md2pptx.
Thanks for the feedback. I don't know where we go from here. BTW I've not heard of GB2312 before.
from md2pptx.
I'm inclined to close this Issue. I don't normally do this without a fix (or similarly valid resolution).
The reason is I don't see a "fix" short of copying the input data to a temporary file with a different encoding. That seems plain wrong to me.
Anyhow I won't close this for a few days. And in any case it can always be reopened.
from md2pptx.
I'm closing now as I don't see a meaningful way to progress it. It can always be re-opened.
from md2pptx.
Related Issues (20)
- how to integrate by code HOT 3
- Is there any tutorial on converting ppt to markdown language, besides examples? HOT 2
- Is it possible to read the image in an adjustable manner? HOT 15
- How to customize the background image of each ppt page? HOT 10
- Move docs to their own subfolder
- Add examples of `contentSplit` and `contentSplitDirection` HOT 1
- Make a card an object HOT 4
- Make graphics in cards clickable HOT 2
- Support video and audio in cards HOT 2
- Enhancement: Provide slide safe area for titles and contents with specific margins HOT 10
- In cards limit media dimensions to those of the card HOT 1
- how to use it HOT 2
- Support Python 3.12 & 3.13 - was "imghdr module not found" HOT 8
- Python comment lines in code blocks are handled improperly HOT 2
- Allow change of font size in a text run HOT 2
- Make Text Parsing More Robust HOT 3
- Allow a slide to be hidden HOT 2
- Latin character í (Latin small letter i with acute) is displayed with errors HOT 8
- Error: Slide Object has no slideInfo attribute HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from md2pptx.