On Tuesday 24 October 2006 13:41, sophana wrote: > > This is correct, since you tell python to add a Unicode-String to an > > Asc-String: > > s += 'café' > > is the same as > > s = s + 'café' > > Ok, but why is the right string encoded into ascii and not into the > same encoding as the left unicode string? > Isn't the += operator an unicode method?
You seem to be very confused about this. The string on the right doesn't need to be encoded to unicode, it needs to be decoded from whatever encoding it has back to unicode. Since you haven't specified any, it automatically picks ASCII. The unicode string on the left doesn't have any encoding attached to be used as you wish, simply because a unicode string doesn't have an encoding attribute. An encoding is used to convert unicode to a string and the resulting string will have a given encoding. -- Dan ------------------------------------------------------------------------- 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