Ronald Oussoren <[EMAIL PROTECTED]> writes: > On Oct 23, 2006, at 10:54 PM, sophana wrote: > >> >> I'm still suffering on the python bug when you add a string to an >> unicode with +=, the string is encoded into ascii. I still don't >> understand why python didn't merge unicode and strings. > > Could you give an example? My understanding of what you write: > > Python 2.4.4 (#1, Oct 18 2006, 10:34:39) > [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > .>> s = u'hello' > .>> s += 'world' > .>> s > u'helloworld' > .>>
Change the order. >>> s = u'olá' >>> s += 'mundo' >>> s u'ol\xe1mundo' >>> s = u'leite com ' >>> s += 'café' Traceback (most recent call last): File "<stdin>", line 1, in ? UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128) >>> -- Jorge Godoy <[EMAIL PROTECTED]>
pgp0uoxc9CJQ8.pgp
Description: PGP signature
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss