#32439: Dumpdata fails on Windows due to non-utf8 system locale
-------------------------------------+-------------------------------------
     Reporter:  helmstedt            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Uncategorized        |                  Version:  3.1
     Severity:  Normal               |               Resolution:
     Keywords:  windows, utf8,       |             Triage Stage:
  encoding, dumpdata                 |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

 Do we enforce utf8 internally? If so we could patch `dumpdata` to pass
 `encoding` to the `open()` call.

 However...

 > But if I am right that Windows will never have utf8 set as a default
 locale...

 That's not quite right. If you go to Settings there's a "Use Unicode UTF-8
 for worldwide language support", box in "Language" - "Administrative
 Language Settings" - "Change system locale" - "Region Settings".

 If we apply that, and reboot, then we get a sensible, modern, default
 encoding from Python:

 {{{
 >>> import _locale
 >>> _locale._getdefaultlocale()
 ('en_GB', 'cp65001')  # This is cp1252 without the setting checked.
 }}}

 [https://groups.google.com/g/django-
 developers/c/ZkmnmGz_W58/m/fb3Fon5gCQAJ This has come up on Django
 Developers before].

 My inclination would be to doc this, as a fix to #26721 maybe, and stick
 there. What do we think?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32439#comment:6>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.3549fffd620f683ea6b2076cdbfc32e4%40djangoproject.com.

Reply via email to