[omaha] Unicode to &

Matt Harriger mharriger at gmail.com
Sun Jun 8 05:07:13 CEST 2008


ord(uchar) (where uchar is a unicode string of length 1) will return the
unicode codepoint for the given char, so ord(Đ) returns 272. "&#" +
str(ord(uchar)) would give you the full HTML entity representation for that
character.

On Sat, Jun 7, 2008 at 4:12 PM, freeav8r <freeav8r at yahoo.com> wrote:

> When you type in a form on a web page, any non ascii characters get
> converted to their &#; equivalent.  As an example,, the capital D with a
> horizontal line gets converted to &#272.
>
> Is there a python module out there that will do this for unicode characters
> with no ascii equivalent?
>
>
>
>
>
> _______________________________________________
> Omaha Python Users Group mailing list
> Omaha at python.org
> http://mail.python.org/mailman/listinfo/omaha
> http://www.OmahaPython.org
>


More information about the Omaha mailing list