Reliably getting/setting the (current) encoding name?

Mike C. Fletcher mcfletch at rogers.com
Fri Jan 31 14:13:42 EST 2003


Michael Hudson wrote:
...

>> >>> sys.getdefaultencoding()
>>'ascii'
>>
>>(Alex mentioned it in his post)
>>    
>>
>
>But that doesn't change to reflect the locale, which I thought was the
>point of what you asked.
>  
>

Well, it does with the hack using setdefaultencoding ;) .

...

>That did occur to me as a possible problem.  Did we mention converting
>your app to all-unicode-all-the-time?  Oh yes, I think you did.  Try
>it: it might not be as hard as you think.  I was surprised how easy it
>was to convert pyrepl.
>  
>

I don't expect it'll be too terribly difficult, but wxprop is heavily 
into types, it's got an lot of automation machinery (including 
type-checking and coercian) for dealing with strings in a GUI as part of 
an object model.  Suddenly switching the object-model to be unicode 
based is probably going to cause headaches with upgrading old content 
and the like.  It's just not a place I want to venture just yet.

>>At the moment, I'm going to go down the path to evil and requiring
>>the application to set a useful default encoding using the hack Alex
>>pointed out.
>>    
>>
>
>Don't come running to us when, etc. :-)
>
>Cheers,
>M.
>

But why am I paying you these huge Python licensing fees then ;) ,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/








More information about the Python-list mailing list