[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
Gephi forumsPlease post new questions on facebook group too (https://www.facebook.com/groups/gephi) 2010-03-31T10:47:08+01:00 https://forum-gephi.org/app.php/feed/topic/102 2010-03-31T10:47:08+01:002010-03-31T10:47:08+01:00 https://forum-gephi.org/viewtopic.php?t=102&p=338#p338 <![CDATA[Re: libgexf python and unicode]]>
I don't see any data.setLabel() function (http://gexf.net/lib/api/functions_func.html#index_s). Where did you find it?

Statistics:Posted by admin — 31 Mar 2010 10:47


]]>
2010-03-31T10:05:51+01:002010-03-31T10:05:51+01:00 https://forum-gephi.org/viewtopic.php?t=102&p=336#p336 <![CDATA[Re: libgexf python and unicode]]> http://diveintopython.org/xml_processing/unicode.html

CODE:

data.setNodeLabel("id",myUnicodeString.encode("utf-8"))
Paul

Statistics:Posted by paul — 31 Mar 2010 10:05


]]>
2010-03-31T09:28:16+01:002010-03-31T09:28:16+01:00 https://forum-gephi.org/viewtopic.php?t=102&p=333#p333 <![CDATA[libgexf python and unicode]]>
My first post here so I start by a big Thank you to the all community of people around gephi and libgexf, you work rocks !

So I am starting to use libgexf through th python bindings.

I do have some nodes label which are unicode strings containing french accents.
When I try a

CODE:

data.setNodeLabel("id",myUnicodeString)
I got this error :
Traceback (most recent call last):
Traceback (most recent call last):
File "sqlToGexf.py", line 61, in ?
data.setNodeLabel(str(idNode),topic)
File "libgexf.py", line 776, in setNodeLabel
def setNodeLabel(self, *args): return _libgexf.Data_setNodeLabel(self, *args)
TypeError: in method 'Data_setNodeLabel', argument 3 of type 'std::string const &'
Ok now if I do this :

CODE:

data.setLabel("id",str(myUnicodeString))
it works till topic contains a unicode char (i.e. contains a french accent)
Traceback (most recent call last):
File "sqlToGexf.py", line 61, in ?
data.setNodeLabel(str(idNode),str(topic))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
Of course I could get rid of accents but well I first want to be sure there's no way to keep my dear french accents ?

thank for your help

Paul

ps: I don't understand the difference between data.setLabel() and data.setNodeLabel()
the first one doesn't accept id, string as parameters... ?

Statistics:Posted by paul — 31 Mar 2010 09:28


]]>