update StdString code on std::string construct function.

This commit is contained in:
hyzboy 2019-12-02 13:08:06 +08:00
parent d8e2bde533
commit 2d8da351ba

View File

@ -14,7 +14,7 @@ inline std::string to_std(const hgl::OSString &str)
{ {
hgl::UTF8String u8_str=hgl::to_u8(str); hgl::UTF8String u8_str=hgl::to_u8(str);
return std::string(u8_str.c_str()); return std::string(u8_str.c_str(),str.Length());
} }
#else #else
inline hgl::OSString std_to_os(const std::string &str) inline hgl::OSString std_to_os(const std::string &str)
@ -24,7 +24,7 @@ inline hgl::OSString std_to_os(const std::string &str)
inline std::string to_std(const hgl::OSString &str) inline std::string to_std(const hgl::OSString &str)
{ {
return std::string(str.c_str()); return std::string(str.c_str(),str.Length());
} }
#endif// #endif//