From 9e5e7c9b556bf9386fb5ad3ecd28b3d43aeeb393 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Thu, 16 Jan 2014 08:25:42 +0100 Subject: libodfgen produces strings in utf8 encoding Change-Id: Iad17f4b4786473205669bd5b080b0a64d4a6a441 Reviewed-on: https://gerrit.libreoffice.org/7455 Reviewed-by: David Tardon Tested-by: David Tardon --- writerperfect/source/common/DocumentHandler.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'writerperfect') diff --git a/writerperfect/source/common/DocumentHandler.cxx b/writerperfect/source/common/DocumentHandler.cxx index 4fd98da571f5..073b9429571b 100644 --- a/writerperfect/source/common/DocumentHandler.cxx +++ b/writerperfect/source/common/DocumentHandler.cxx @@ -41,17 +41,20 @@ void DocumentHandler::startElement(const char *psName, const WPXPropertyList &xP // filter out libwpd elements if (strncmp(i.key(), "libwpd", 6) != 0) { - pAttrList->AddAttribute(OUString::createFromAscii(i.key()), - OUString::createFromAscii(i()->getStr().cstr())); + OUString sName(i.key(), strlen(i.key()), RTL_TEXTENCODING_UTF8); + OUString sValue(i()->getStr().cstr(), strlen(i()->getStr().cstr()), RTL_TEXTENCODING_UTF8); + pAttrList->AddAttribute(sName, sValue); } } - mxHandler->startElement(OUString::createFromAscii(psName), xAttrList); + OUString sElementName(psName, strlen(psName), RTL_TEXTENCODING_UTF8); + mxHandler->startElement(sElementName, xAttrList); } void DocumentHandler::endElement(const char *psName) { - mxHandler->endElement(OUString::createFromAscii(psName)); + OUString sElementName(psName, strlen(psName), RTL_TEXTENCODING_UTF8); + mxHandler->endElement(sElementName); } void DocumentHandler::characters(const WPXString &sCharacters) -- cgit