user_encoding fix

Nir Soffer nirs at freeshell.org
Mon Feb 20 17:57:49 GMT 2006


On 20/02/2006, at 18:04, John A Meinel wrote:

> Users need to set LANG on Mac OSX anyway. Otherwise 'ls' and friends
> won't do the right thing. I came across that before I had problems with
> bzr. (I've never used bzr to control unicode filenames in a real
> application, but I have created unicode filenames for personal stuff).

Requiring users to set LANG is a problem, bzr should simply work out of 
the box for the common case. But if it really works, maybe its a better 
solution.

I tested LANG on 10.3 (same result in x11 terminal and Terminal.app):

	$ LANG=en_US.UTF-8 python -c 'import locale; print 
locale.getpreferredencoding()'
	mac-roman

So it does not help to get the input encoding.

	$ LANG=en_US.UTF-8 python -c 'import sys; print sys.stdout.encoding'
	UTF-8

Works for the output encoding, so the special checks for darwin can be 
eliminated.



Best Regards,

Nir Soffer





More information about the bazaar mailing list