Fixed: Copy to clipboard mangles utf8 chars

--HG--
branch : develop
This commit is contained in:
Nimetu 2019-02-11 12:45:37 +02:00
parent 5e68a4e293
commit 0e4048661c

View file

@ -748,8 +748,12 @@ namespace NLGUI
{ {
virtual void execute (CCtrlBase *pCaller, const std::string &params) virtual void execute (CCtrlBase *pCaller, const std::string &params)
{ {
if (!CViewRenderer::getInstance()->getDriver()->copyTextToClipboard(params)) ucstring s;
s.fromUtf8(params);
if (!CViewRenderer::getInstance()->getDriver()->copyTextToClipboard(s))
{
nlwarning("Copy to clipboard failed: '%s'", params.c_str()); nlwarning("Copy to clipboard failed: '%s'", params.c_str());
}
} }
}; };
REGISTER_ACTION_HANDLER(CAHCopyToClipboard, "copy_to_clipboard"); REGISTER_ACTION_HANDLER(CAHCopyToClipboard, "copy_to_clipboard");