View Single Post
Old 10-09-2007, 09:20 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,461
Karma: 27757440
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
u'\u00ad'.join(result_of_call_to_hyphenate)

you'd need to recursively process the root tag of beautiful soup. All text is a tag of class NavigableString. Use isinstance to test for it. I'm not sure how easy it is to replace strings in the soup, but once you figure that out all you need to do is print unicode(soup).encode('utf-8')
kovidgoyal is online now   Reply With Quote