[issue10542] Py_UNICODE_NEXT and other macros for surrogates

Eric Smith report at bugs.python.org
Sat Nov 27 02:56:00 CET 2010

Eric Smith <eric at trueblade.com> added the comment:

The code will basically be:

  Py_UCS4 fill;

  parse_format_string(fmt, ..., &fill, ...);

  /* lots more code */

  if (fill_needed) {
    /* compute how many characters to reserve */
    space_needed = Py_UNICODE_NUM_NEEDED(fill) *

It would be most convenient (and require the fewest changes) if the computation could just use fill, instead of remembering the pointers to the beginning and end of fill.

Py_UNICODE_CODEPOINT_COUNT could be implemented with a primitive that does what I want.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list