Re: [Re: [libxml++] UTF8 support]



This discussion seems to have gone a bit out of hand, but anyway,
here's my view of it.  These are the main features I want regarding
character conversion:

 1. The library should efficiently cope with any legal XML.

 2. I want to be able to get a std::string (with a specified encoding)
    of a value.  Most of the XML I will handle will be ISO8859-15
    (thats just me, but replace the encoding with other encodings and
    a lot will be covered).

 3. When necesarry, I want to be able to get a std::wstring (a
    std::string of wide characters).  I want to be able to handle
    individual characters in the string, and I want to use standard
    C++.  Then this is the "correct" way of handling unicode strings.

 4. Sometimes, it would probably be nice to get utf8 data as well.

The ordering of the points reflects their relative importance to me
personally, but I believe the following conclusions to hold regardless
of how the points are reordered:

Point one suggests that the library should use utf8 internally.  I
don't care much how this is done, but some kind of refptr<char*> seems
relatively sane while putting utf8 data in a std::string feels bad.

Points 2 - 4 suggests that the get_ / set_ string methods should be
templated on string class and conversion method.  The alternative is
that I would have to call a converter at every call to a get_ / set_
string method, meaning in practice that I would have to write a
wrapper around libxml++ (which would feel ridiculous, since libxml++
itself is a wrapper around libxml).


Note that this _doesnt_ imply that the entire libxml++ would go from a
"dynamic library" to a "template library".  Just that some of the
methods would be templates.  Also, "common instatiations" of a
template method can - at least threoreticlly - be included in a
dynamic library.


-- 
Rasmus Kaj ----------------------------------------------- rasmus kaj se
 \ What is the word where la is the middle, is the beginning, and the end?
  \------------------------------------- http://www.stacken.kth.se/~kaj/




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