[Zope3-Users] TAL expression and ascii

Justin Fletcher justin at opensoft.ws
Fri Dec 14 08:39:13 EST 2007


Top replying to my own post...  I believe I figured out the problem.

In my latest tests I was using unicode(variable, encoding="utf-8") for
all of the variables _except_ the return of BeautifulSoup...  I my haste
I overlooked it... which is silly because I know BeautifulSoup returns
UTF-8.  After fixing the conversion of that data the accented characters
are appearing correctly in the browser and all is well.

Thanks again for the help!  Character encoding was something I had only
rarely dealt with so the pointers provided offered a great learning
opportunity.

-Justin


On Fri, 2007-12-14 at 14:12 +0100, Justin Fletcher wrote:
> On Fri, 2007-12-14 at 12:23 +0200, Marius Gedminas wrote:
> > On Fri, Dec 14, 2007 at 01:20:52AM +0100, Justin Fletcher wrote:
> 
> <snip>
> 
> > 
> > There's no magic.  "Zope 3 strings are Unicode" is a convention, and
> > Zope makes it easy to follow by decoding all HTTP request strings into
> > Unicode objects.  If you're migrating existing non-Unicode data into
> > ZODB with a simple Python script, you'll have to take care of converting
> > your binary strings to Unicode yourself.
> > 
> > > Am I misunderstanding something or doing something wrong?
> > 
> > I think so.  If you could show us how you're migrating "some data" into
> > the ZODB, we could give you more advice.
> > 
> > Regards,
> > Marius Gedminas
> 
> Thanks for your help so far.  It has already given me some things to
> try.  Unfortunately I am still unable to get it to completely work,
> though I have made progress.
> 




More information about the Zope3-users mailing list