The encoding for the character type functions. Fallback to 'ascii' if the #encoding is unsupported by Python or could not be determined. See tickets #10335 and #5846.
()
| 246 | |
| 247 | |
| 248 | def get_system_encoding(): |
| 249 | """ |
| 250 | The encoding for the character type functions. Fallback to 'ascii' if the |
| 251 | #encoding is unsupported by Python or could not be determined. See tickets |
| 252 | #10335 and #5846. |
| 253 | """ |
| 254 | try: |
| 255 | encoding = locale.getlocale()[1] or "ascii" |
| 256 | codecs.lookup(encoding) |
| 257 | except Exception: |
| 258 | encoding = "ascii" |
| 259 | return encoding |
| 260 | |
| 261 | |
| 262 | DEFAULT_LOCALE_ENCODING = get_system_encoding() |
no outgoing calls