On Thu, Jan 20, 2011 at 11:03 AM, Daniel Holth <[email protected]> wrote:
> My favorite is http://pypi.python.org/pypi/Unidecode
>
> It does transliteration, so for example it knows something about the ASCII
> that sounds like Chinese characters.
>
> It won't help you convert spaces to hyphens.
webhelpers.text.urlify(string)
Create a URI-friendly representation of the string
Can be called manually in order to generate an URI-friendly
version of any string.
If the unidecode package is installed, it will also transliterate
non-ASCII Unicode characters to their nearest pronounciation
equivalent in ASCII.
Examples::
>>> urlify("Mighty Mighty Bosstones")
'mighty-mighty-bosstones'
webhelpers.text.remove_formatting(string)
Simplify HTML text by removing tags and several kinds of formatting.
If the unidecode package is installed, it will also transliterate
non-ASCII Unicode characters to their nearest pronunciation equivalent
in ASCII.
http://webhelpers.groovie.org/modules/text.html
--
Mike Orr <[email protected]>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en.