On Sun, 2007-09-09 at 20:04 -0700, Asheesh Laroia wrote:
> On Sun, 9 Sep 2007, iain duncan wrote:
>
> >> The process seems to go ok, but only 1 character of my input gets
> >> through. This wasn't happening with beautiful soup so I am at a loss as
> >> to what could be going on. The validator runs after a formencode
> >> UnicodeString validator in a validators.All() pair. If anyone can shed
> >> some light on this it would be most appreciated.
> >
> > I've narrowed the problem down to unicode input. When I send unicode
> > into tidy.parseString(), I get the same error. As far as I can tell from
> > the tidy and form encode docs, it looks like I should be able to tell
> > tidylib that the char_encoding is utf8 and it should be ok, but I get
> > nothing out. So, still stumped in case anyone who has used tidy with
> > unicode has a suggestion.
>
> Try instead of:
>
> s = u'bbq'
> tidy.tidy(s)
>
> doing:
>
> s = u'bbq'
> tidy.tidy(s.encode('utf-8'))
>
> Note that I don't know the API, but the point is that you could try
> passing tidy UTF-8 input rather than pure Python Unicode strings.
Thanks Asheesh! I've been pulling my hair out trying to wrap my head
around the unicode maze. I thought from the the formencode docs that
whatever encoding was necessary had already been done, but I guess not
because the above did the trick!
Iain
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---