Comment 5 for bug 79084

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 79084] Re: Annotate with --show-ids has encoding problem

John A Meinel пишет:
> fair enough. So the question becomes, what is more useful to you,
> Alexander. osutils.terminal_encoding() or get_user_encoding()
>
> I realize you may not use 'bzr annotate' much. I'm just trying to figure
> out if 'terminal_encoding()' is going to be better because people
> typically only have ascii text, and are trying to annotate on a
> terminal. Or if user encoding is better, because they will tend to have
> ascii annotations anyway, and if they have non-ascii text, they have the
> best chance of being able to read it by redirecting to a file, and
> reading it there.
>
> My gut feeling is that 'get_user_encoding()' is better in this instance,
> which is why it is what my patch does.

Thinking more about this I want to say that encoding problems is very frustrating.
On Windows users typically edit their files in GUI editors and therefore
use ANSI encoding (i.e. get_user_encoding). When bzr provide good GUI
for bzr it's easy to say that get_user_encoding is best guess.

But for some old-fashioned boys who remember DOS days and still use OEM encodings
for their files -- int this case using user encoding is wrong.

And because user can control encoding of terminal with chcp command
it's better to use terminal encoding.

It's really hard to say exactly what's better... Sigh...

--
Alexander