Changes between Version 2 and Version 3 of Ticket #32439
- Timestamp:
- Feb 12, 2021, 4:08:43 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32439 – Description
v2 v3 7 7 "To save json data in django the TextIOWrapper is used: 8 8 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) (...) 10 In documentation of locale.getpreferredencoding fuction we can read:'' 11 11 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.'' 13 13 14 Here I found "hacky" but working method to overwrite these settings: 14 ''Here I found "hacky" but working method to overwrite these settings:'' 15 15 16 In file settings.py of your django project add these lines: 16 ''In file settings.py of your django project add these lines:'' 17 17 18 import _locale19 _locale._getdefaultlocale = (lambda *args: ['en_US', 'utf8'])"'' 18 ''import _locale 19 _locale._getdefaultlocale = (lambda *args: ['en_US', 'utf8'])"'''' 20 20 21 21 In Python I can my "inspect _locale._getdefaultlocale" variable in my (Danish) Windows installation: