[Zope] Unicode/string question

Chris Muldrow cmuldrow@fredericksburg.com
Fri, 13 Sep 2002 10:17:43 -0400


So, my cloud of stupidity just lifted, and I think I've seen the light. I
just realized my string never actually got turned into unicode along the
way--I'm actually dealing with an ascii string and a utf-8 string. When I
encode the ascii into utf-8 with asciistring.encode("utf-8"), I can
concatenate them together. Thanks for the help--your answer got my mind
turning a different direction. - Chris
> 
> You are mixing:
> 1. A unicode string
> 2. A plain 8-bit string with characters outside the ascii range.
> 
> Its not clear from the code fragment which strings are the unicode ones, and
> which are not. I suggest you work all in unicode.... You need to convert
> those 8 bit strings into unicode strings by applying a character encoding
> using code like...
> 
> myunicodestring = unicode(my8bitstring,'utf-8')
> 
> 
> ....substitute 'utf-8' for whatever character encoding you are using.
> 
> 
> 
>