[reportlab-users] speeding up parse_utf8?

Marius Gedminas reportlab-users@reportlab.com
Tue, 14 Oct 2003 23:29:38 +0300


--uAKRQypu60I7Lcqm
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 14, 2003 at 07:53:37PM +0100, Robin Becker wrote:
> >yes I'm being particularly stupid today. I rewrote the ttfonts
> >parse_utf8 as a c function and it's marginally faster than the built in
> >one, I actually need the UCS int values rather than the unicode string
> >itself. Is there an easy way to proceed when I have a PyUnicode object
> >to get at those. I assume that Py_UNICODE* PyUnicode_AS_UNICODE(PyObject
> >*o) returns some kind of 32 bit things, but I probably need to handle
> >the mapping to 32 bit unsigned myself in case the local machine byte
> >order is wrong.
>
> I'm still stupid, Py_UNICODE is 16 bit unsigned. So I guess I can do my
> thing pretty easily.

AFAIU there's a compile time option to choose either 16 or 32 bits.

Marius Gedminas
--=20
Hanlon's Razor:
        Never attribute to malice that which is adequately explained
        by stupidity.

--uAKRQypu60I7Lcqm
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/jFyykVdEXeem148RAvMHAKCG/+lcghJl0ITzs7Q7R6in+giKKwCeKLiq
1Awt2H4CwvmKQbPZJhtsphI=
=BeIt
-----END PGP SIGNATURE-----

--uAKRQypu60I7Lcqm--