Changes between Version 2 and Version 3 of Ticket #32439


Ignore:
Timestamp:
Feb 12, 2021, 4:08:43 AM (4 years ago)
Author:
helmstedt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32439 – Description

    v2 v3  
    77"To save json data in django the TextIOWrapper is used:
    88
    9 The default encoding is now locale.getpreferredencoding(False) (...)
    10 In documentation of locale.getpreferredencoding fuction we can read:
     9''The default encoding is now locale.getpreferredencoding(False) (...)
     10In documentation of locale.getpreferredencoding fuction we can read:''
    1111
    12 Return the encoding used for text data, according to user preferences. User preferences are expressed differently on different systems, and might not be available programmatically on some systems, so this function only returns a guess.
     12''Return the encoding used for text data, according to user preferences. User preferences are expressed differently on different systems, and might not be available programmatically on some systems, so this function only returns a guess.''
    1313
    14 Here I found "hacky" but working method to overwrite these settings:
     14''Here I found "hacky" but working method to overwrite these settings:''
    1515
    16 In file settings.py of your django project add these lines:
     16''In file settings.py of your django project add these lines:''
    1717
    18 import _locale
    19 _locale._getdefaultlocale = (lambda *args: ['en_US', 'utf8'])"''
     18''import _locale
     19_locale._getdefaultlocale = (lambda *args: ['en_US', 'utf8'])"''''
    2020
    2121In Python I can my "inspect _locale._getdefaultlocale" variable in my (Danish) Windows installation:
Back to Top