Fix accidental rename of strings to tqunicode

pull/1/head
Timothy Pearson 13 years ago
parent 71cbc66f6c
commit e832e9f2ab

@ -162,7 +162,7 @@ Argument Annotations
encoding is ``"None"`` and the ``str`` type otherwise.
Python v2 will use the ``str`` type to represent the argument if the
encoding is ``"None"`` and the ``tqunicode`` type otherwise.
encoding is ``"None"`` and the ``unicode`` type otherwise.
.. argument-annotation:: GetWrapper

@ -202,13 +202,13 @@ specification files.
``u`` (long) [unsigned int]
Convert a C/C++ ``unsigned int`` to a Python long.
``w`` (tqunicode/string) [wchar_t]
Convert a C/C++ wide character to a Python v2 tqunicode object or a
``w`` (unicode/string) [wchar_t]
Convert a C/C++ wide character to a Python v2 unicode object or a
Python v3 string object.
``x`` (tqunicode/string) [wchar_t \*]
``x`` (unicode/string) [wchar_t \*]
Convert a C/C++ ``L'\0'`` terminated wide character string to a Python
v2 tqunicode object or a Python v3 string object. If the string pointer
v2 unicode object or a Python v3 string object. If the string pointer
is ``NULL`` then the result is ``Py_None``.
``A`` (string) [char \*]
@ -272,8 +272,8 @@ specification files.
Convert a named C/C++ ``enum`` to an instance of the corresponding
Python named enum type.
``G`` (tqunicode) [wchar_t \*, :cmacro:`SIP_SSIZE_T`]
Convert a C/C++ wide character array and its length to a Python tqunicode
``G`` (unicode) [wchar_t \*, :cmacro:`SIP_SSIZE_T`]
Convert a C/C++ wide character array and its length to a Python unicode
object. If the array is ``NULL`` then the length is ignored and the
result is ``Py_None``.
@ -1124,7 +1124,7 @@ specification files.
Convert a Python string-like object of length 1 to a C/C++ ``char``
according to the encoding ``e``. ``e`` can either be ``A`` for ASCII,
``L`` for Latin-1, or ``8`` for UTF-8. For Python v2 the object may be
either a string or a tqunicode object that can be encoded. For Python v3
either a string or a unicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.
@ -1182,12 +1182,12 @@ specification files.
``u`` (long) [unsigned int \*]
Convert a Python long to a C/C++ ``unsigned int``.
``w`` (tqunicode/string) [wchar_t \*]
Convert a Python v2 string or tqunicode object or a Python v3 string
``w`` (unicode/string) [wchar_t \*]
Convert a Python v2 string or unicode object or a Python v3 string
object of length 1 to a C/C++ wide character.
``x`` (tqunicode/string) [wchar_t \*\*]
Convert a Python v2 string or tqunicode object or a Python v3 string
``x`` (unicode/string) [wchar_t \*\*]
Convert a Python v2 string or unicode object or a Python v3 string
object to a C/C++ ``L'\0'`` terminated wide character string. If the
Python object is ``Py_None`` then the string is ``NULL``.
@ -1199,7 +1199,7 @@ specification files.
identifies the object in the context defined by the ``S`` format
character and allows an extra reference to the object to be kept to
ensure that the string remains valid. For Python v2 the object may be
either a string or a tqunicode object that can be encoded. For Python v3
either a string or a unicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.
@ -1258,8 +1258,8 @@ specification files.
``F`` (wrapped enum) [:ctype:`sipTypeDef` \*, enum \*]
Convert a Python named enum type to the corresponding C/C++ ``enum``.
``G`` (tqunicode/string) [wchar_t \*\*, :cmacro:`SIP_SSIZE_T` \*]
Convert a Python v2 string or tqunicode object or a Python v3 string
``G`` (unicode/string) [wchar_t \*\*, :cmacro:`SIP_SSIZE_T` \*]
Convert a Python v2 string or unicode object or a Python v3 string
object to a C/C++ wide character array and its length. If the Python
object is ``Py_None`` then the array and length are ``NULL`` and zero
respectively.

@ -515,7 +515,7 @@ the correct type prior to conversion.
When used as part of a class specification it can automatically convert
additional types of Python object. For example, PyQt uses it in the
specification of the ``QString`` class to allow Python string objects and
tqunicode objects to be used wherever ``QString`` instances are expected.
unicode objects to be used wherever ``QString`` instances are expected.
The following variables are made available to the handwritten code:

@ -552,8 +552,8 @@ Support for Wide Characters
---------------------------
SIP v4.6 introduced support for wide characters (i.e. the ``wchar_t`` type).
Python's C API includes support for converting between tqunicode objects and wide
character strings and arrays. When converting from a tqunicode object to wide
Python's C API includes support for converting between unicode objects and wide
character strings and arrays. When converting from a unicode object to wide
characters SIP creates the string or array on the heap (using memory allocated
using :cfunc:`sipMalloc()`). This then raises the problem of how this memory
is subsequently freed.

@ -2202,7 +2202,7 @@ if ( document.querySelectorAll ) (function(){
var oldSizzle = Sizzle, div = document.createElement("div");
div.innerHTML = "<p class='TEST'></p>";
// Safari can't handle uppercase or tqunicode characters when
// Safari can't handle uppercase or unicode characters when
// in quirks mode.
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
return;

@ -191,7 +191,7 @@ directive. If the directive is not specified then <tt class="xref docutils lite
<p>Python v3 will use the <tt class="docutils literal"><span class="pre">bytes</span></tt> type to represent the argument if the
encoding is <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt> and the <tt class="docutils literal"><span class="pre">str</span></tt> type otherwise.</p>
<p>Python v2 will use the <tt class="docutils literal"><span class="pre">str</span></tt> type to represent the argument if the
encoding is <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt> and the <tt class="docutils literal"><span class="pre">tqunicode</span></tt> type otherwise.</p>
encoding is <tt class="docutils literal"><span class="pre">&quot;None&quot;</span></tt> and the <tt class="docutils literal"><span class="pre">unicode</span></tt> type otherwise.</p>
</dd></dl>
<dl class="argument-annotation">

@ -261,12 +261,12 @@ the result is <tt class="docutils literal"><span class="pre">Py_None</span></tt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt> to a Python long.</dd>
<dt><tt class="docutils literal"><span class="pre">u</span></tt> (long) [unsigned int]</dt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt> to a Python long.</dd>
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (tqunicode/string) [wchar_t]</dt>
<dd>Convert a C/C++ wide character to a Python v2 tqunicode object or a
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (unicode/string) [wchar_t]</dt>
<dd>Convert a C/C++ wide character to a Python v2 unicode object or a
Python v3 string object.</dd>
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (tqunicode/string) [wchar_t *]</dt>
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (unicode/string) [wchar_t *]</dt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">L'\0'</span></tt> terminated wide character string to a Python
v2 tqunicode object or a Python v3 string object. If the string pointer
v2 unicode object or a Python v3 string object. If the string pointer
is <tt class="docutils literal"><span class="pre">NULL</span></tt> then the result is <tt class="docutils literal"><span class="pre">Py_None</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">A</span></tt> (string) [char *]</dt>
<dd>Convert a C/C++ <tt class="docutils literal"><span class="pre">'\0'</span></tt> terminated string to a Python v2 or v3 string
@ -329,8 +329,8 @@ Python named enum type.</p>
<dt><tt class="docutils literal"><span class="pre">F</span></tt> (wrapped enum) [enum, <tt class="xref docutils literal"><span class="pre">sipTypeDef</span></tt> *]</dt>
<dd>Convert a named C/C++ <tt class="docutils literal"><span class="pre">enum</span></tt> to an instance of the corresponding
Python named enum type.</dd>
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (tqunicode) [wchar_t *, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a>]</dt>
<dd>Convert a C/C++ wide character array and its length to a Python tqunicode
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (unicode) [wchar_t *, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a>]</dt>
<dd>Convert a C/C++ wide character array and its length to a Python unicode
object. If the array is <tt class="docutils literal"><span class="pre">NULL</span></tt> then the length is ignored and the
result is <tt class="docutils literal"><span class="pre">Py_None</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">N</span></tt> (wrapped instance) [<em>type</em> *, <tt class="xref docutils literal"><span class="pre">sipTypeDef</span></tt> *, PyObject *]</dt>
@ -1428,7 +1428,7 @@ to be passed.</p>
<dd>Convert a Python string-like object of length 1 to a C/C++ <tt class="docutils literal"><span class="pre">char</span></tt>
according to the encoding <tt class="docutils literal"><span class="pre">e</span></tt>. <tt class="docutils literal"><span class="pre">e</span></tt> can either be <tt class="docutils literal"><span class="pre">A</span></tt> for ASCII,
<tt class="docutils literal"><span class="pre">L</span></tt> for Latin-1, or <tt class="docutils literal"><span class="pre">8</span></tt> for UTF-8. For Python v2 the object may be
either a string or a tqunicode object that can be encoded. For Python v3
either a string or a unicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.</dd>
<dt><tt class="docutils literal"><span class="pre">b</span></tt> (integer) [bool *]</dt>
@ -1472,11 +1472,11 @@ then the string is <tt class="docutils literal"><span class="pre">NULL</span></t
<dd>Convert a Python long to a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">short</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">u</span></tt> (long) [unsigned int *]</dt>
<dd>Convert a Python long to a C/C++ <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">int</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (tqunicode/string) [wchar_t *]</dt>
<dd>Convert a Python v2 string or tqunicode object or a Python v3 string
<dt><tt class="docutils literal"><span class="pre">w</span></tt> (unicode/string) [wchar_t *]</dt>
<dd>Convert a Python v2 string or unicode object or a Python v3 string
object of length 1 to a C/C++ wide character.</dd>
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (tqunicode/string) [wchar_t **]</dt>
<dd>Convert a Python v2 string or tqunicode object or a Python v3 string
<dt><tt class="docutils literal"><span class="pre">x</span></tt> (unicode/string) [wchar_t **]</dt>
<dd>Convert a Python v2 string or unicode object or a Python v3 string
object to a C/C++ <tt class="docutils literal"><span class="pre">L'\0'</span></tt> terminated wide character string. If the
Python object is <tt class="docutils literal"><span class="pre">Py_None</span></tt> then the string is <tt class="docutils literal"><span class="pre">NULL</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">Ae</span></tt> (object) [int, const char **]</dt>
@ -1487,7 +1487,7 @@ ASCII, <tt class="docutils literal"><span class="pre">L</span></tt> for Latin-1,
identifies the object in the context defined by the <tt class="docutils literal"><span class="pre">S</span></tt> format
character and allows an extra reference to the object to be kept to
ensure that the string remains valid. For Python v2 the object may be
either a string or a tqunicode object that can be encoded. For Python v3
either a string or a unicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.</dd>
<dt><tt class="docutils literal"><span class="pre">B</span></tt> (string/bytes) [int, const char **]</dt>
@ -1548,8 +1548,8 @@ not passed if this flag is specified.</dd>
</dd>
<dt><tt class="docutils literal"><span class="pre">F</span></tt> (wrapped enum) [<tt class="xref docutils literal"><span class="pre">sipTypeDef</span></tt> *, enum *]</dt>
<dd>Convert a Python named enum type to the corresponding C/C++ <tt class="docutils literal"><span class="pre">enum</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (tqunicode/string) [wchar_t **, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a> *]</dt>
<dd>Convert a Python v2 string or tqunicode object or a Python v3 string
<dt><tt class="docutils literal"><span class="pre">G</span></tt> (unicode/string) [wchar_t **, <a title="SIP_SSIZE_T" class="reference internal" href="#SIP_SSIZE_T"><tt class="xref docutils literal"><span class="pre">SIP_SSIZE_T</span></tt></a> *]</dt>
<dd>Convert a Python v2 string or unicode object or a Python v3 string
object to a C/C++ wide character array and its length. If the Python
object is <tt class="docutils literal"><span class="pre">Py_None</span></tt> then the array and length are <tt class="docutils literal"><span class="pre">NULL</span></tt> and zero
respectively.</dd>

@ -516,7 +516,7 @@ the correct type prior to conversion.</p>
<p>When used as part of a class specification it can automatically convert
additional types of Python object. For example, PyTQt uses it in the
specification of the <tt class="docutils literal"><span class="pre">TQString</span></tt> class to allow Python string objects and
tqunicode objects to be used wherever <tt class="docutils literal"><span class="pre">TQString</span></tt> instances are expected.</p>
unicode objects to be used wherever <tt class="docutils literal"><span class="pre">TQString</span></tt> instances are expected.</p>
<p>The following variables are made available to the handwritten code:</p>
<dl class="docutils">
<dt>int *sipIsErr</dt>

File diff suppressed because one or more lines are too long

@ -567,8 +567,8 @@ ignored.</p>
<div class="section" id="support-for-wide-characters">
<h2>Support for Wide Characters<a class="headerlink" href="#support-for-wide-characters" title="Permalink to this headline"></a></h2>
<p>SIP v4.6 introduced support for wide characters (i.e. the <tt class="docutils literal"><span class="pre">wchar_t</span></tt> type).
Python&#8217;s C API includes support for converting between tqunicode objects and wide
character strings and arrays. When converting from a tqunicode object to wide
Python&#8217;s C API includes support for converting between unicode objects and wide
character strings and arrays. When converting from a unicode object to wide
characters SIP creates the string or array on the heap (using memory allocated
using <a title="sipMalloc" class="reference external" href="c_api.html#sipMalloc"><tt class="xref docutils literal"><span class="pre">sipMalloc()</span></tt></a>). This then raises the problem of how this memory
is subsequently freed.</p>

@ -639,8 +639,8 @@ static void generateInternalAPIHeader(sipSpec *pt, moduleDef *mod,
"#define sipString_AsLatin1String sipAPI_%s->api_string_as_latin1_string\n"
"#define sipString_AsUTF8Char sipAPI_%s->api_string_as_utf8_char\n"
"#define sipString_AsUTF8String sipAPI_%s->api_string_as_utf8_string\n"
"#define sipUnicode_AsWChar sipAPI_%s->api_tqunicode_as_wchar\n"
"#define sipUnicode_AsWString sipAPI_%s->api_tqunicode_as_wstring\n"
"#define sipUnicode_AsWChar sipAPI_%s->api_unicode_as_wchar\n"
"#define sipUnicode_AsWString sipAPI_%s->api_unicode_as_wstring\n"
"#define sipConvertFromConstVoidPtr sipAPI_%s->api_convert_from_const_void_ptr\n"
"#define sipConvertFromVoidPtrAndSize sipAPI_%s->api_convert_from_void_ptr_and_size\n"
"#define sipConvertFromConstVoidPtrAndSize sipAPI_%s->api_convert_from_const_void_ptr_and_size\n"
@ -5335,7 +5335,7 @@ static void generateClassFunctions(sipSpec *pt, moduleDef *mod, classDef *cd,
for (md = cd->members; md != NULL; md = md->next)
if (cd->iff->type == namespace_iface)
generateOrdinaryFunction(pt, mod, cd, NULL, md, fp);
else if (md->slot != no_slot && md->slot != tqunicode_slot)
else if (md->slot != no_slot && md->slot != unicode_slot)
generateSlot(mod, cd, NULL, md, fp);
if (cd->iff->type != namespace_iface && !generating_c)

@ -8821,7 +8821,7 @@ static memberDef *findFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope,
int nrargs; /* Nr. of arguments. */
} slot_table[] = {
{"__str__", str_slot, TRUE, 0},
{"__unicode__", tqunicode_slot, TRUE, 0},
{"__unicode__", unicode_slot, TRUE, 0},
{"__int__", int_slot, FALSE, 0},
{"__long__", long_slot, FALSE, 0},
{"__float__", float_slot, FALSE, 0},

@ -5232,7 +5232,7 @@ static memberDef *findFunction(sipSpec *pt, moduleDef *mod, classDef *c_scope,
int nrargs; /* Nr. of arguments. */
} slot_table[] = {
{"__str__", str_slot, TRUE, 0},
{"__unicode__", tqunicode_slot, TRUE, 0},
{"__unicode__", unicode_slot, TRUE, 0},
{"__int__", int_slot, FALSE, 0},
{"__long__", long_slot, FALSE, 0},
{"__float__", float_slot, FALSE, 0},

@ -426,7 +426,7 @@
typedef enum {
str_slot,
tqunicode_slot,
unicode_slot,
int_slot,
long_slot,
float_slot,

@ -126,8 +126,8 @@ extern "C" {
* Added sip_api_transfer_break().
*
* 3.4 Added qt_find_connection() to the TQt support API.
* Added sip_api_string_as_char(), sip_api_tqunicode_as_wchar(),
* sip_api_tqunicode_as_wstring(), sip_api_find_class(),
* Added sip_api_string_as_char(), sip_api_unicode_as_wchar(),
* sip_api_unicode_as_wstring(), sip_api_find_class(),
* sip_api_find_named_enum() and sip_api_parse_signature().
* Added the 'A', 'w' and 'x' format characters to sip_api_parse_args(),
* sip_api_parse_result(), sip_api_build_result() and
@ -1355,11 +1355,11 @@ typedef struct _sipAPIDef {
char (*api_string_as_utf8_char)(PyObject *obj);
const char *(*api_string_as_utf8_string)(PyObject **obj);
#if defined(HAVE_WCHAR_H)
wchar_t (*api_tqunicode_as_wchar)(PyObject *obj);
wchar_t *(*api_tqunicode_as_wstring)(PyObject *obj);
wchar_t (*api_unicode_as_wchar)(PyObject *obj);
wchar_t *(*api_unicode_as_wstring)(PyObject *obj);
#else
int (*api_tqunicode_as_wchar)(PyObject *obj);
int *(*api_tqunicode_as_wstring)(PyObject *obj);
int (*api_unicode_as_wchar)(PyObject *obj);
int *(*api_unicode_as_wstring)(PyObject *obj);
#endif
int (*api_deprecated)(const char *classname, const char *method);
void (*api_keep_reference)(PyObject *self, int key, PyObject *obj);

@ -232,11 +232,11 @@ static const char *sip_api_string_as_latin1_string(PyObject **obj);
static char sip_api_string_as_utf8_char(PyObject *obj);
static const char *sip_api_string_as_utf8_string(PyObject **obj);
#if defined(HAVE_WCHAR_H)
static wchar_t sip_api_tqunicode_as_wchar(PyObject *obj);
static wchar_t *sip_api_tqunicode_as_wstring(PyObject *obj);
static wchar_t sip_api_unicode_as_wchar(PyObject *obj);
static wchar_t *sip_api_unicode_as_wstring(PyObject *obj);
#else
static int sip_api_tqunicode_as_wchar(PyObject *obj);
static int *sip_api_tqunicode_as_wstring(PyObject *obj);
static int sip_api_unicode_as_wchar(PyObject *obj);
static int *sip_api_unicode_as_wstring(PyObject *obj);
#endif
static void sip_api_transfer_break(PyObject *self);
static int sip_api_deprecated(const char *classname, const char *method);
@ -357,8 +357,8 @@ static const sipAPIDef sip_api = {
sip_api_string_as_latin1_string,
sip_api_string_as_utf8_char,
sip_api_string_as_utf8_string,
sip_api_tqunicode_as_wchar,
sip_api_tqunicode_as_wstring,
sip_api_unicode_as_wchar,
sip_api_unicode_as_wstring,
sip_api_deprecated,
sip_api_keep_reference,
sip_api_parse_kwd_args,
@ -6302,7 +6302,7 @@ static void sip_api_no_method(PyObject *parseErr, const char *scope,
/*
* Return a string/tqunicode object extracted from a particular line of a
* Return a string/unicode object extracted from a particular line of a
* docstring.
*/
static PyObject *signature_FromDocstring(const char *doc, SIP_SSIZE_T line)
@ -6339,7 +6339,7 @@ static PyObject *signature_FromDocstring(const char *doc, SIP_SSIZE_T line)
/*
* Return a string/tqunicode object that describes the given failure.
* Return a string/unicode object that describes the given failure.
*/
static PyObject *detail_FromFailure(PyObject *failure_obj)
{
@ -9888,7 +9888,7 @@ static char sip_api_string_as_ascii_char(PyObject *obj)
#if PY_MAJOR_VERSION >= 3
"bytes or ASCII string of length 1 expected not '%s'",
#else
"string or ASCII tqunicode of length 1 expected not '%s'",
"string or ASCII unicode of length 1 expected not '%s'",
#endif
Py_TYPE(obj)->tp_name);
@ -9924,7 +9924,7 @@ static char sip_api_string_as_latin1_char(PyObject *obj)
#if PY_MAJOR_VERSION >= 3
"bytes or Latin-1 string of length 1 expected not '%s'",
#else
"string or Latin-1 tqunicode of length 1 expected not '%s'",
"string or Latin-1 unicode of length 1 expected not '%s'",
#endif
Py_TYPE(obj)->tp_name);
@ -9960,7 +9960,7 @@ static char sip_api_string_as_utf8_char(PyObject *obj)
#if PY_MAJOR_VERSION >= 3
"bytes or UTF-8 string of length 1 expected not '%s'",
#else
"string or UTF-8 tqunicode of length 1 expected not '%s'",
"string or UTF-8 unicode of length 1 expected not '%s'",
#endif
Py_TYPE(obj)->tp_name);
@ -10028,7 +10028,7 @@ static const char *sip_api_string_as_ascii_string(PyObject **obj)
#if PY_MAJOR_VERSION >= 3
"bytes or ASCII string expected not '%s'",
#else
"string or ASCII tqunicode expected not '%s'",
"string or ASCII unicode expected not '%s'",
#endif
Py_TYPE(s)->tp_name);
@ -10067,7 +10067,7 @@ static const char *sip_api_string_as_latin1_string(PyObject **obj)
#if PY_MAJOR_VERSION >= 3
"bytes or Latin-1 string expected not '%s'",
#else
"string or Latin-1 tqunicode expected not '%s'",
"string or Latin-1 unicode expected not '%s'",
#endif
Py_TYPE(s)->tp_name);
@ -10106,7 +10106,7 @@ static const char *sip_api_string_as_utf8_string(PyObject **obj)
#if PY_MAJOR_VERSION >= 3
"bytes or UTF-8 string expected not '%s'",
#else
"string or UTF-8 tqunicode expected not '%s'",
"string or UTF-8 unicode expected not '%s'",
#endif
Py_TYPE(s)->tp_name);
@ -10215,7 +10215,7 @@ static int parseBytes_AsString(PyObject *obj, const char **ap)
/*
* Convert a Python object to a wide character.
*/
static wchar_t sip_api_tqunicode_as_wchar(PyObject *obj)
static wchar_t sip_api_unicode_as_wchar(PyObject *obj)
{
wchar_t ch;
@ -10225,7 +10225,7 @@ static wchar_t sip_api_tqunicode_as_wchar(PyObject *obj)
#if PY_MAJOR_VERSION >= 3
"string"
#else
"tqunicode string"
"unicode string"
#endif
" of length 1 expected, not %s", Py_TYPE(obj)->tp_name);
@ -10239,7 +10239,7 @@ static wchar_t sip_api_tqunicode_as_wchar(PyObject *obj)
/*
* Convert a Python object to a wide character string on the heap.
*/
static wchar_t *sip_api_tqunicode_as_wstring(PyObject *obj)
static wchar_t *sip_api_unicode_as_wstring(PyObject *obj)
{
wchar_t *p;
@ -10249,7 +10249,7 @@ static wchar_t *sip_api_tqunicode_as_wstring(PyObject *obj)
#if PY_MAJOR_VERSION >= 3
"string"
#else
"tqunicode string"
"unicode string"
#endif
" expected, not %s", Py_TYPE(obj)->tp_name);
@ -10437,7 +10437,7 @@ static int convertToWCharString(PyObject *obj, wchar_t **ap)
/*
* Convert a Python object to a wide character.
*/
static int sip_api_tqunicode_as_wchar(PyObject *obj)
static int sip_api_unicode_as_wchar(PyObject *obj)
{
raiseNoWChar();
@ -10448,7 +10448,7 @@ static int sip_api_tqunicode_as_wchar(PyObject *obj)
/*
* Convert a Python object to a wide character.
*/
static int *sip_api_tqunicode_as_wstring(PyObject *obj)
static int *sip_api_unicode_as_wstring(PyObject *obj)
{
raiseNoWChar();

@ -162,7 +162,7 @@ Argument Annotations
encoding is ``"None"`` and the ``str`` type otherwise.
Python v2 will use the ``str`` type to represent the argument if the
encoding is ``"None"`` and the ``tqunicode`` type otherwise.
encoding is ``"None"`` and the ``unicode`` type otherwise.
.. argument-annotation:: GetWrapper

@ -202,13 +202,13 @@ specification files.
``u`` (long) [unsigned int]
Convert a C/C++ ``unsigned int`` to a Python long.
``w`` (tqunicode/string) [wchar_t]
Convert a C/C++ wide character to a Python v2 tqunicode object or a
``w`` (unicode/string) [wchar_t]
Convert a C/C++ wide character to a Python v2 unicode object or a
Python v3 string object.
``x`` (tqunicode/string) [wchar_t \*]
``x`` (unicode/string) [wchar_t \*]
Convert a C/C++ ``L'\0'`` terminated wide character string to a Python
v2 tqunicode object or a Python v3 string object. If the string pointer
v2 unicode object or a Python v3 string object. If the string pointer
is ``NULL`` then the result is ``Py_None``.
``A`` (string) [char \*]
@ -272,8 +272,8 @@ specification files.
Convert a named C/C++ ``enum`` to an instance of the corresponding
Python named enum type.
``G`` (tqunicode) [wchar_t \*, :cmacro:`SIP_SSIZE_T`]
Convert a C/C++ wide character array and its length to a Python tqunicode
``G`` (unicode) [wchar_t \*, :cmacro:`SIP_SSIZE_T`]
Convert a C/C++ wide character array and its length to a Python unicode
object. If the array is ``NULL`` then the length is ignored and the
result is ``Py_None``.
@ -1124,7 +1124,7 @@ specification files.
Convert a Python string-like object of length 1 to a C/C++ ``char``
according to the encoding ``e``. ``e`` can either be ``A`` for ASCII,
``L`` for Latin-1, or ``8`` for UTF-8. For Python v2 the object may be
either a string or a tqunicode object that can be encoded. For Python v3
either a string or a unicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.
@ -1182,12 +1182,12 @@ specification files.
``u`` (long) [unsigned int \*]
Convert a Python long to a C/C++ ``unsigned int``.
``w`` (tqunicode/string) [wchar_t \*]
Convert a Python v2 string or tqunicode object or a Python v3 string
``w`` (unicode/string) [wchar_t \*]
Convert a Python v2 string or unicode object or a Python v3 string
object of length 1 to a C/C++ wide character.
``x`` (tqunicode/string) [wchar_t \*\*]
Convert a Python v2 string or tqunicode object or a Python v3 string
``x`` (unicode/string) [wchar_t \*\*]
Convert a Python v2 string or unicode object or a Python v3 string
object to a C/C++ ``L'\0'`` terminated wide character string. If the
Python object is ``Py_None`` then the string is ``NULL``.
@ -1199,7 +1199,7 @@ specification files.
identifies the object in the context defined by the ``S`` format
character and allows an extra reference to the object to be kept to
ensure that the string remains valid. For Python v2 the object may be
either a string or a tqunicode object that can be encoded. For Python v3
either a string or a unicode object that can be encoded. For Python v3
the object may either be a bytes object or a string object that can be
encoded. An object that supports the buffer protocol may also be used.
@ -1258,8 +1258,8 @@ specification files.
``F`` (wrapped enum) [:ctype:`sipTypeDef` \*, enum \*]
Convert a Python named enum type to the corresponding C/C++ ``enum``.
``G`` (tqunicode/string) [wchar_t \*\*, :cmacro:`SIP_SSIZE_T` \*]
Convert a Python v2 string or tqunicode object or a Python v3 string
``G`` (unicode/string) [wchar_t \*\*, :cmacro:`SIP_SSIZE_T` \*]
Convert a Python v2 string or unicode object or a Python v3 string
object to a C/C++ wide character array and its length. If the Python
object is ``Py_None`` then the array and length are ``NULL`` and zero
respectively.

@ -515,7 +515,7 @@ the correct type prior to conversion.
When used as part of a class specification it can automatically convert
additional types of Python object. For example, PyQt uses it in the
specification of the ``QString`` class to allow Python string objects and
tqunicode objects to be used wherever ``QString`` instances are expected.
unicode objects to be used wherever ``QString`` instances are expected.
The following variables are made available to the handwritten code:

@ -552,8 +552,8 @@ Support for Wide Characters
---------------------------
SIP v4.6 introduced support for wide characters (i.e. the ``wchar_t`` type).
Python's C API includes support for converting between tqunicode objects and wide
character strings and arrays. When converting from a tqunicode object to wide
Python's C API includes support for converting between unicode objects and wide
character strings and arrays. When converting from a unicode object to wide
characters SIP creates the string or array on the heap (using memory allocated
using :cfunc:`sipMalloc()`). This then raises the problem of how this memory
is subsequently freed.

Loading…
Cancel
Save