Hi,

I hope the encoding type of the download plintext file is ANSI, not UTF-8.

View.py

...
with open(file_path + filename, 'r', encoding='cp949') as fd:
    # This plain text file from inside the server is an ANSI (cp949) 
encoded file.
    response = HttpResponse(fd) 
    response['Content-Type'] = "text/plain" 
    response['Content -Disposition'] = "attachment; filename=%s" % filename 

return response
...

When text file is downloaded from chromium-based browser, it is downloaded 
as autf-8 encoding text file.

How can I modify the web server(views.py) to download as an ANSI (CP949) 
encoded text file?

Best Regards



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b17c36e8-6f0e-46b1-936d-520cd24b0c2dn%40googlegroups.com.

Reply via email to