HELP! WString always empty
Greetings,
First time caller, long time listener...
I'm importing an HTML template from file via std::string, then attempting to construct a WString object with that std::string, but the WString is always empty. I've tried using every constructor I could find, as well as using the static Wt:WString::fromUTF8, all resulting in the same empty string with junk characters in the buffer. I'm developing in Visual Studio 2022, en-US.UTF-8 locale. The HTML file is stored in UTF-8 format.
if (MainPageTemplateString.empty())
{
std::string templateContent = loadStringFromFile("./MainPageTemplate.htm");
auto MainPageTemplateString = Wt::WString::fromUTF8(templateContent.c_str());
}
Please see attached clip file. The utf8 member shows the right size, but Capacity 0 and the content bytes are wrong. It's almost like the output of Wt::WString::fromUTF8 to MainPageTemplateString gets corrupted. Any advice as to what I could be doing wrong would be greatly appreciated.
Chuck

Replies (1)
RE: HELP! WString always empty - Added by Chuck R 9 days ago
UPDATE: Solved. It seemed to be a linkage issue. I switched over to the debug WT DLLs and it seemed to have fixed it.