summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide')
-rw-r--r--plugins/pychrysalide/format/strsym.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/pychrysalide/format/strsym.c b/plugins/pychrysalide/format/strsym.c
index 30224f8..8c210a2 100644
--- a/plugins/pychrysalide/format/strsym.c
+++ b/plugins/pychrysalide/format/strsym.c
@@ -73,12 +73,13 @@ static PyObject *py_string_symbol_get_raw(PyObject *self, void *closure)
{
PyObject *result; /* Valeur à retourner */
GStrSymbol *symbol; /* Elément à consulter */
+ size_t len; /* Taille de la chaîne */
const char *data; /* Données à manipuler */
symbol = G_STR_SYMBOL(pygobject_get(self));
- data = g_string_symbol_get_raw(symbol);
+ data = g_string_symbol_get_raw(symbol, &len);
- result = PyBytes_FromString(data);
+ result = PyBytes_FromStringAndSize(data, len);
return result;
@@ -102,12 +103,13 @@ static PyObject *py_string_symbol_get_utf8(PyObject *self, void *closure)
{
PyObject *result; /* Valeur à retourner */
GStrSymbol *symbol; /* Elément à consulter */
+ size_t len; /* Taille de la chaîne */
const char *data; /* Données à manipuler */
symbol = G_STR_SYMBOL(pygobject_get(self));
- data = g_string_symbol_get_raw(symbol);
+ data = g_string_symbol_get_utf8(symbol, &len);
- result = PyUnicode_FromString(data);
+ result = PyUnicode_FromStringAndSize(data, len);
return result;