Re: [xml] libxml vs stl



Jim wrote:
Hi,

Just a simple question.

When dealing with inputs from libxml i would like to use a stl string
like class ...
Is this a good idea?

If you are sure about the data being in the ASCII range the answer may
be yes.

Is there a class that supports wide strings in C++ stl?

std::wstring, though I'm not sure you really mean wide string here.
std::wstring is based on wchar_t, which isn't necessarily large enough
to hold arbitrary unicode (i.e. utf-32) either, if that is what you are
after.

Or am i better using the provide string functions in libxml?

You probably want some unicode library in conjunction with libxml2.
The remaining question then is about how to pass data between that unicode
library and libxml2.

I have been suggesting a new C++ API (wrapper around libxml2) on boost.org
(http://boost.org/) and a big part of the discussion is precisly about how
best to do that conversion (see http://lists.boost.org/Archives/boost/2005/10/96129.php)

FWIW,
                Stefan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]