Comments (4)
unidecode dependency seems required to support old browsers
312170c
http://kbyanc.blogspot.hk/2010/07/serving-file-downloads-with-non-ascii.html
maybe it could be done optional, for example:
- make an explicit setting to not set filename as ascii and so don't use unidecode
- use a try except and don't set filename as ascii if unidecode is not installed
what do you think about?
from django-sendfile.
I guess it could be possible to remove the dependency. The Unidecode package does appear to do a pretty good job, but if we just want to do something basic then something like this might work well enough:
import unicodedata
unicodedata.normalize('NFKD', attachment_filename).encode('ascii','ignore')
from here:
http://stackoverflow.com/questions/2365411/python-convert-unicode-to-ascii-without-errors
Care to submit a patch/pull request for it?
from django-sendfile.
created a pull request, thanks!
from django-sendfile.
Merged it and made a new version (0.3.10), which is now also on PyPi.
Thank you.
from django-sendfile.
Related Issues (20)
- mod_wsgi backend broken on Django 1.8 HOT 9
- Our abc.tar.gz file sent using this django-sendfile was automatically getting unzipped by the browser
- Release 0.3.8 HOT 2
- Problem with unicode characters HOT 10
- PyPi page looks strange HOT 2
- Is status really "Beta"? HOT 5
- Content-Disposition: Output contains buffer repr (Python 3.4) HOT 1
- Django 1.9 support HOT 4
- How to make "private" media accessible by site staff? HOT 1
- Add tests running in CI
- Support wheel packaging
- Serve a folder with sendfile
- Simple backend will decompress file HOT 1
- Maintaining the project HOT 12
- Apache 2.4 EnableSendfile as a potential replacement for XSendfile HOT 3
- I have to append `media/` to the path to not get a 404
- How to override the image url / path?
- Django 2.1 and above has removed the permalink() decorator HOT 1
- Please redirect to django-sendfile2
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 django-sendfile.