diff -r 85741b08db48 -r 14e14a5db027 src/XercesStringConvertor.h --- a/src/XercesStringConvertor.h Fri Jan 11 16:20:25 2019 +0100 +++ b/src/XercesStringConvertor.h Fri Jan 11 17:41:56 2019 +0100 @@ -38,7 +38,7 @@ public: - string_t toString(const XMLCh * const chars) { + string_t toString(const XMLCh* const chars) { // XMLCh = char16_t // „All XML data is handled within Xerces-C++ as strings of XMLCh characters. Regardless of the size of the type chosen, the data stored in variables of type XMLCh will always be utf-16 encoded values.“ // see https://xerces.apache.org/xerces-c/program-others-3.html @@ -50,6 +50,14 @@ XMLString::release(&x); return convertor.from_bytes(s); } + + /** + * @param string + * @return Xerces string. Must be released manually after use, see XMLString::release(). + */ + XMLCh* toXercesString(string_t string) { + return XMLString::transcode(convertor.to_bytes(string).c_str()); + } }; }