unicode in python

M.-A. Lemburg mal at lemburg.com
Wed Jun 7 07:22:03 EDT 2000


Sameh chafik pro wrote:
> 
> I see that thy are a Unicode support.
> if S is a unicode sitring we can write s = u'thome thing'. that work quite
> well in python mode.
> my problem is how can i do to catch this string in a C/C++ programe with the
> PyArg_ParseTuple fonction.
> can i naïfly write PyArg_ParseTuple(Arg,"U",AString);
> I try that and it dos'nt work.

The above will give you a Unicode object. You may want to
look at the API docs in 1.6 for more infos on how to convert
them to other storage types for use in C/C++. The file
Include/unicodeobject.h also has quite a lot to say :-)

Note that

 Py_UNICODE *v;
 PyArg_ParseTuple(Arg,"u",v);

will give you access to the raw Py_UNICODE buffer in the
Unicode object.
 
> Sam.
> 
> Sameh chafik pro <chafik at nevrax.com> a écrit dans le message :
> 8gaor8$6kq$1 at gw.localdomain...
> > Okay, i turne my question in an ather way,
> > How is the standard way to print text in Chinese or Japanese with the
> Python
> > API ?
> > In reality i'am looking for a solution for the international display in
> > multi-plate form and i want to use Python for resolve this problem.
> >
> > Sam.
> >
> > Robert <rhicks at rma.edu> a écrit dans le message : uhgV4.36$Z9.2056 at news...
> > > It is being written into version 1.6...
> > >
> > > Bob
> > >
> > > Sameh chafik pro <chafik at nevrax.com> wrote in message
> > > news:8g3m0b$nb7$1 at gw.localdomain...
> > > > Hello evry body,
> > > > I want to know if there are any Unicode module support in python ansd
> if
> > > yes
> > > > were can i find a document or a sample for using it.
> > > > thank.
> > > >
> > > >
> > >
> > >
> >
> >

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/




More information about the Python-list mailing list