version-info --include-history UnicodeDecodeError (518609)
Robert Collins
robertc at robertcollins.net
Fri Apr 9 02:03:12 BST 2010
On Fri, 2010-04-09 at 09:51 +0900, Stephen J. Turnbull wrote:
> Robert Collins writes:
>
> > version info has a number of different formatters available; some may
> > make sense only as files, some could encode to the local encoding. I
> > don't think thats ideal; perhaps we could make the formatter 'know' that
> > it is writing to stdout and error unless stdout is a pipe (and thus
> > presumably being redirected). That seems fragile though.
>
> Nope. This is TOOWTDI. Inside of Bazaar, everything should be
> explicitly Unicode (if "text", ie, intended to be human-readable) or
> str (if humans never read it without the intermediation of some
> application). Stuff in str format probably should be encapsulated in
> some class, but that's beyond the scope of this post. Unicode is
> *the* encapsulation for text. End of story.
As already said in this thread, RIO isn't 'text', its a defined series
of bytes.
> This implies that text *must* be converted on exit from Bazaar.
yes
> All
> exits must be watched, just as all entrances must be watched.
yes
> stdout
> and stderr are nondeterministic, but the heuristic "convert to
> top-level locale encoding if a TTY, else to UTF-8" should work well in
> practice. (Except maybe on Windows, where the widechar Unicode API
> might be more appropriate for non-TTYs.)
That is the heuristic I was talking about.
-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20100409/9f9c661b/attachment-0001.pgp
More information about the bazaar
mailing list