Unicode -> UTF-8
ignacio at openservices.net
Mon Sep 3 19:01:18 CEST 2001
On Mon, 3 Sep 2001, Alex Martelli wrote:
> "Ignacio Vazquez-Abrams" <ignacio at openservices.net> wrote in message
> news:mailman.999477366.3290.python-list at python.org...
> > What's the easiest way in C to get the contents of a PyUnicodeObject (or a
> > PyStringObject for that matter) as UTF-8?
> What about (warning, untested code):
> Is this what you had in mind?
Yikes. It probably works, but I don't think taht's how I want to do it.
> but I'm unclear on the status/usability of PyArg_Parse -- the
> current docs say it's all right to use it to analyze other
> object (not arguments), but I've seen people "in the know"
> just flat out advise against using it and claiming it is in
> fact deprecated (without qualifying that warning with "for
> argument parsing only"). Maybe this thread can lead to some
> useful clarification in this regard...?
I think I'm going to stay away from Parg_Parse(), thanks.
I was poking around in the Python 2.1.1 headers, and I found two API
functions, PyUnicode_AsUTF8String() and PyUnicode_DecodeUTF8(). Does anyone
have anything to say on the implications of using these functions (other than
the normal caveat of using undocumented functions ;) )?
Ignacio Vazquez-Abrams <ignacio at openservices.net>
More information about the Python-list