[merge] Unicode Exception fixes
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Aug 21 21:51:04 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Arbash Meinel wrote:
> Aaron Bentley wrote:
>
>>I would think we should
>>continue, and let get_cmd_object raise "unknown command" as usual.
>
>
> I could go either way. But raising an explicit error helps people
> realize that we don't support unicode command names.
>
> This could also be done on the register_command() side.
> At the very least this gives a nicer traceback.
I think
1. regular users should not care whether we support unicode command
names. When we get internationalized, I expect we *will* support
unicode command names, anyhow.
2. yes, it would be nice to let developers know we don't support unicode
command names at register_command time.
>>I think this is going too far; a string may be unicode while still being
>>convertible-to-ascii. In any case, we may well be able to print errors
>>in unicode, which would be preferable.
>>
>>How about:
>
>
>
> You forget that utf-8 is a strict superset of ascii. All ascii
> characters are unchanged in utf-8.
You're right; I got confuzzled by the earlier repr discussion.
> So your proposal actually always
> gives the same result, only you have to catch yet another exception.
Well, not exactly the same result, because it also provides a
__unicode__ builtin, which would allow us get the unicode
representation. OTOH, if we somehow get 8-bit arguments to an error, it
will fail more often.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFE6hy40F+nu1YWqI0RAlWrAKCBpBbqS4wVHP0CwYsAumJ5QZRTUQCgiMOe
xUa18SrY+dCSz2Le06drMH8=
=6YAZ
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list