Fix URL encode issue.

This commit is contained in:
Chunting Gu
2019-09-18 14:03:16 +08:00
parent 53a731caf5
commit 9f3d968e77
11 changed files with 81 additions and 214 deletions
-1
View File
@@ -1 +0,0 @@
#include "webcc/encoding.h"
-21
View File
@@ -1,21 +0,0 @@
#ifndef WEBCC_ENCODING_H_
#define WEBCC_ENCODING_H_
#include <string>
#include <codecvt>
namespace webcc {
std::string Utf16ToUtf8(const std::wstring& utf16_string) {
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
return converter.to_bytes(utf16_string);
}
std::wstring Utf8ToUtf16(const std::string& utf8_string) {
std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
return converter.from_bytes(utf8_string);
}
} // namespace webcc
#endif // WEBCC_ENCODING_H_