多字节字符串转宽字符字符串
| 76 | |
| 77 | // 多字节字符串转宽字符字符串 |
| 78 | std::wstring StringToWString(const std::string& str) |
| 79 | { |
| 80 | if (str.empty()) |
| 81 | return L""; |
| 82 | |
| 83 | int size_needed = MultiByteToWideChar(CP_ACP, 0, &str[0], (int)str.size(), |
| 84 | NULL, 0); |
| 85 | std::wstring wstrTo(size_needed, 0); |
| 86 | MultiByteToWideChar(CP_ACP, 0, &str[0], (int)str.size(), |
| 87 | &wstrTo[0], size_needed); |
| 88 | return wstrTo; |
| 89 | } |
| 90 | |
| 91 | // 辅助函数:从字符串中提取引号内的内容 |
| 92 | std::string ExtractQuotedString(const std::string& str, size_t start_pos) |