Message: previous - next
Month: March 2016

[SOLVED] Re: TQString::fromUtf8 vs TQString::fromLatin1 [possible bug in parseVCard]

From: deloptes <deloptes@...>
Date: Fri, 25 Mar 2016 16:59:38 +0100
deloptes wrote:

> However this works in my test program
>         std::string teststr(newItem.ascii());
>         std::cout << teststr << "\n";
> and this contradicts the logic of ascii all äöü are there

Looking further into it I solved the issue by passing c_str() to parseVCard

        TDEABC::Addressee addressee = converter.parseVCard(item.c_str());

works OK

and when reading an item the same, after converting the TQString into
std::string, passing the c_str() to the function.

works OK

so in both directions now encoding is preserved.

thanks for the hints and advises, without your help I wouldn't have solved
it so fast.