[BUNDLE] Make additional chance to obtain right encoding of console when output piped

John Arbash Meinel john at arbash-meinel.com
Fri Jun 9 21:32:06 BST 2006


Alexander Belchenko wrote:
> I wrote about this fact before: when output of bzr command piped to
> another program, i.e. when run something like:
> 
> bzr log | less
> 
> Then sys.stdout lose their own encoding attribute value and bzr switch
> to use bzrlib.user_encoding value. That behaviour on some system is
> inappropriate, see bug 5041 as example.
> 
> But when only stdout piped out then stdin is not touched and behaves
> normally. So bzr should try to use information from sys.stdin.encoding
> to detect *right* encoding of console.
> 
> I make small improvements to the function that detect output_encoding
> and give a chance to use stdin encoding when stdout piped. This patch
> allow me to obtain log with russian messages in right encoding when I
> run bzr simply in console or when output piped to 'less' pager.
> 
> If someone think that this patch will not works in some circumstances
> then speak on. I'm willing to restrict this solution only to win32
> platform. Otherwise give me +.
> 
> -- 
> Alexander
> 

+1 and sent to the pqm.

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060609/570cd375/attachment.pgp 


More information about the bazaar mailing list