use UTF-8 for string representation

This commit is contained in:
Jinhao
2015-12-31 01:09:52 +08:00
parent 0a396c12c2
commit a42ebe19b4
38 changed files with 182 additions and 416 deletions

View File

@@ -98,12 +98,13 @@ namespace system
}
//open an url through a default browser
void open_url(const std::wstring& url)
void open_url(const std::string& url_utf8)
{
if(url.empty())
if(url_utf8.empty())
return;
#if defined(NANA_WINDOWS)
std::wstring url = to_wstring(url_utf8);
if(::ShellExecute(0, L"open", url.c_str(), 0, 0, SW_SHOWNORMAL) < reinterpret_cast<HINSTANCE>(32))
{
//Because ShellExecute can delegate execution to Shell extensions (data sources, context menu handlers,