Skip to content

Commit

Permalink
注释改为utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
RERASER committed Sep 20, 2024
1 parent 3081277 commit eee64b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/utils/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ namespace utils::string
{
std::string buffer;

auto size = WideCharToMultiByte(65001, 0, str.data(), -1, nullptr, 0, nullptr, nullptr);//这里返回的大小包含null
auto size = WideCharToMultiByte(65001, 0, str.data(), -1, nullptr, 0, nullptr, nullptr);//这里返回的大小包含null
size--;
buffer.resize(size);

WideCharToMultiByte(65001, 0, str.data(), -1, buffer.data(), size, nullptr, nullptr);//如果显式指定大小则可以不包含null
WideCharToMultiByte(65001, 0, str.data(), -1, buffer.data(), size, nullptr, nullptr);//如果显式指定大小则可以不包含null

return buffer;
}
Expand Down

0 comments on commit eee64b3

Please sign in to comment.