#29817: Deprecate FILE_CHARSET setting
------------------------------------------------+------------------------
               Reporter:  Jon Dufresne          |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  Core (Other)          |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 The setting was introduced in
 
[https://github.com/django/django/commit/953badbea5a04159adbfa970f5805c0232b6a401
 953badbea5a04159adbfa970f5805c0232b6a401].

 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.12fee2d466431a6481dbe5694f50b3b4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to