Re: [libxml++] program crashes when parsing XML with accent
- From: Christophe de VIENNE <cdevienne alphacent com>
- To: libxmlplusplus-general lists sourceforge net
- Subject: Re: [libxml++] program crashes when parsing XML with accent
- Date: Wed, 05 May 2004 11:55:05 +0200
Jonathan Wakely wrote:
On Tue, May 04, 2004 at 11:13:54PM +0200, Christophe de Vienne wrote:
Christophe de Vienne wrote:
The solution is, I think, to instanciate like this :
Glib::ustring( std::string(ch, len) )
This should not make unecessary buffer copy with g++ 3.x at least, since
std::string has a COW implementation, and Glib::ustring constructor
taking a std::string just copy it.
How about using this ctor taking an iterator range:
template <class InputIterator>
Glib::ustring::ustring(InputIterator begin, InputIterator end);
<snip>
It's so evident it's the right solution I'm ashamed I didn't see it !
I'll commit this ASAP.
Christophe
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]