This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chemacortes
Recipients
Date 2002-07-06.01:11:04
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=78289

We, as non-english writers, need 'getdefaultlocale' to set the default encoding for 
unicode strings: 
 
lang,encoding=locale.getdefaultlocale() 
sys.setdefaultencoding(encoding) 
 
The problem can be fixed easyly by insert the new locales into the locale_alias of 
module locale: 
 
locale_alias={ 
... 
  "de_de@euro": "de_DE.iso8859_15", 
  "de_at@euro": "de_AT@iso8859_15", 
  "es_es@euro":"es_ES@iso8859_15", 
... 
} 
 
As a workarround, you can modify the locale_alias into the sitecustomize.py 
 
# adding euro locales 
import locale 
eurolocs=[ "ca_ES", "da_DK", "de_AT", "de_BE", "de_DE", "de_LU", "en_BE", 
           "en_IE", "es_ES", "eu_ES", "fi_FI", "fr_BE", "fr_FR", "fr_LU", 
           "ga_IE", "gl_ES", "it_IT", "nl_BE", "nl_NL", "pt_PT", "sv_FI" 
] 
 
for l in eurolocs: 
   key=l.lower()+"@euro"          # eg: "es_es@euro" 
   cod=l+".iso8859_15"            # eg: "es_ES.iso8859_15" 
   locale.locale_alias[key]=cod 
 
# Setting the unicode default encoding 
import sys 
if hasattr(sys,"setdefaultencoding"): 
  lang,encoding=locale.getdefaultlocale() 
  sys.setdefaultencoding(encoding) 
 
History
Date User Action Args
2007-08-23 14:01:14adminlinkissue554676 messages
2007-08-23 14:01:14admincreate