Comments (3)
This is a legitimate bug but I'm not sure what the correct fix is. It's possible to construct a surrogate pair to represent the character, with something like:
struct.pack('<L', 0x10000).decode('utf-32')
Which will "work", but perhaps cause other bugs down the line with e.g. slicing. So maybe we shouldn't do it.
Other alternatives include replacing it with '?', or just raising a different exception type. I haven't decided.
from pyth.
I like the solution: replacing with ? + log message
from pyth.
I've tried the struct trick above. It means that plugins should never trust len() of unicode strings, or slice them. But that's probably true anyway.
from pyth.
Related Issues (20)
- rtf reader: decode argument TypeError HOT 2
- Feature request: Add support for reading simple RTF tables HOT 1
- CJK characters support for RTF parse HOT 5
- Please upload a new release to PyPi HOT 3
- newline for plaintext writer HOT 2
- Hex (encoded images) in `\pict` control groups is not removed. HOT 5
- Implement lists in RTF reader HOT 1
- Bump to 0.6.1? HOT 4
- Python 3 support HOT 2
- Add more tests, for instance from unrtf HOT 1
- pyth.__version__ claims to be 0.5.6 even though packaged as 0.6.0
- Exclude images when writing plain text files
- Parsing RTF fails when an escaped quote is followed by non-hex digits
- PlainTextWriter adds extraneous newline after each paragraph
- Unicode error when reading RTF HOT 3
- Import field text from RTFs
- Parse colortbl and colored text
- Request - Support for parsing string instead of file
- problem with reading file.rtf with table inside
- wiki.github.com/brendonh/pyth is a broken link
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 pyth.