You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
Hello all,
I've got a function-based generic view that I want to return a utf-16le encoded response (for use as an InDesign tagged text file; the utf-16le is what InDesign wants). I've got it working here, but am wondering if there's an more straightforward way.
For comparison, the "original" utf-8 encoded version is here and shorter. I tried a
response.content.encode('utf-16le')
as response seems to have some sort of HttpResponse wrapper on it.
Thanks, John
Tim Chase
unread,
May 21, 2015, 4:25:31 PM5/21/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com, jhe...@earthlink.net
On 2015-05-21 13:04, JHeasly wrote:
> I've got a function-based generic view that I want to return a
> utf-16le encoded response (for use as an InDesign tagged text file;
> the utf-16le is what InDesign wants). I've got it working here
but otherwise, I suspect the extras code is just the cost of doing
something off the ordinary path.
-tkc
Stephen J. Butler
unread,
May 22, 2015, 2:09:33 AM5/22/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I think that looks fine. I would change the mimetype to "text/plain;
charset=UTF-16LE" just to play nice, but it probably will never matter
with your Content-Disposition. Also, HttpResponse's mimetype parameter
has been deprecated since 1.5; use content_type instead.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
@Tim: render_to_string! Forgot about that, somehow. That could clean it up a bit. Thanks!
@Stephen: Thanks for the feedback. This app's running internally and is on insecure and ancient 1.4, but the mimetype parameter reminder is a good one! Thank you.