view Python/formatter_unicode.c @ 56951:db4dfdc74029

in wide builds, avoid storing high unicode characters from source code with surrogates This is accomplished by decoding with utf-32 instead of utf-16 on all builds. The patch is by Adam Olsen.
author Benjamin Peterson <benjamin@python.org>
date Wed, 28 Oct 2009 21:59:39 +0000
parents 2c60ac4ed65f
children 8beaa9a37387
line wrap: on
line source

/* implements the unicode (as opposed to string) version of the
   built-in formatters for string, int, float.  that is, the versions
   of int.__float__, etc., that take and return unicode objects */

#include "Python.h"
#include "../Objects/stringlib/unicodedefs.h"


#define FORMAT_STRING  _PyUnicode_FormatAdvanced
#define FORMAT_LONG    _PyLong_FormatAdvanced
#define FORMAT_FLOAT   _PyFloat_FormatAdvanced
#define FORMAT_COMPLEX _PyComplex_FormatAdvanced

#include "../Objects/stringlib/formatter.h"