To expand Armin's answer, the two most "visible" effects for end users are:

- some_unicode.encode('utf-8') is essentially for free (because it is
already UTF-8 internally)
- some_bytes.decode('utf-8') is very chep (it just needs to check that
some_bytes is valid utf-8)

ciao,
Anto


On Wed, Feb 26, 2020 at 4:47 PM Armin Rigo <armin.r...@gmail.com> wrote:

> Hi Jerry,
>
> On Wed, 26 Feb 2020 at 16:09, Jerry Spicklemire <jspicklem...@gmail.com>
> wrote:
> > Is there a tutorial about how to best take advantage of PyPy's internal
> UTF8?
>
> For best or for worse, this is only an internal feature.  It has no
> effect for the end user.  In particular, Python programs written for
> PyPy3.6 and for CPython3.6 should work identically.  The fact that it
> uses internally utf-8 is not visible to the Python
> program---otherwise, it would never be cross-compatible.
>
>
> A bientôt,
>
> Armin.
> _______________________________________________
> pypy-dev mailing list
> pypy-dev@python.org
> https://mail.python.org/mailman/listinfo/pypy-dev
>
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to