About encoding issues

Robert Collins robertc at robertcollins.net
Tue Aug 15 01:12:32 BST 2006


On Mon, 2006-04-24 at 10:46 +0200, Jan Hudec wrote:
> 
> > We can fix this by either making them u"" unicode literals, or  
> > explicitly converting in the places that print them.  It may be  
> > worthwhile doing so that we can get errors on implicit conversion
> of  
> > non-ascii strings.
> 
> It would be worthwhile to file a wishlist item against python for
> file-level 'all literals are unicode' declaration (like perl has).
> 
> For the time beingh we will have to add 'u' to all literals anyway.

I think forcing all strings in our source to be u prefixed is a really
bad idea - its ugly to read, its surprising to casual contributors from
elsewhere in python, and we already have a solution in the code base:

bzrlib.osutils.safe_unicode.

Every function that desires unicode-or-ascii should upcast its
parameters via this.

We had a long thread on this previously FWIW.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060815/0a84f2e4/attachment.pgp 


More information about the bazaar mailing list