It looks as `settings.FILE_CHARSET` is no longer necessary and could
easily be deprecated. Its existence is
[https://docs.djangoproject.com/en/dev/ref/unicode/#templates justified
as]:
> But the common case is to read templates from the filesystem, and this
creates a slight complication: not all filesystems store their data
encoded as UTF-8. If your template files are not stored with a UTF-8
encoding, set the FILE_CHARSET setting to the encoding of the files on
disk. When Django reads in a template file, it will convert the data from
this encoding to Unicode.
Which seems suspect to me. I'm not aware of any modern environment that
can't UTF-8 encode files to disk.
Its use is extremely limited in the code. After removal, we could instead
document that files must be encoded using UTF-8.
Much like `DEFAULT_CONTENT_TYPE`, this setting doesn't play well with
third-party libraries. If a project were to use this setting, it might be
unable to load templates from third-party libraries that used the default
UTF-8 encoding.
Further, this setting is entirely untested.
--
Ticket URL: <https://code.djangoproject.com/ticket/29817>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/10472 PR]
Additionally, there was some discussion of this in
[https://github.com/django/django/pull/10428#discussion_r219679706
PR#10428] which motivated this work.
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:1>
Comment (by Carlton Gibson):
This would be nice. Django-developers thread asking for input:
https://groups.google.com/d/topic/django-developers/7bZbYVV6hg4/discussion
— lets see if there are any issues raised.
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:2>
* status: new => closed
* resolution: => wontfix
Comment:
Initial feedback on the thread is that this probably **IS** needed. I'm
going to close as `wontfix` on that basis, but **happy to reopen** if the
discussion develops there.
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:3>
Comment (by Carlton Gibson):
So the discussion evolve such that it looks like the only issue here would
be enforcing the use of UTF-8 in editors (for template files etc).
Is that something we want to do? (Not, as yet, answers on the thread re
that.)
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:4>
* status: closed => new
* resolution: wontfix =>
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:5>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"0cd465b63aa7c03a3d14bd5fd6543628d585f8da" 0cd465b]:
{{{
#!CommitTicketReference repository=""
revision="0cd465b63aa7c03a3d14bd5fd6543628d585f8da"
Fixed #29817 -- Deprecated settings.FILE_CHARSET.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:7>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"3d716467a9f046c7af4fb62c13e6b975c06c135f" 3d716467]:
{{{
#!CommitTicketReference repository=""
revision="3d716467a9f046c7af4fb62c13e6b975c06c135f"
Refs #29817 -- Removed settings.FILE_CHARSET per deprecation timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29817#comment:8>