This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <codecvt> | |
std::string name = "李研"; // GBK encoding | |
std::wstring w_name = string2wstring(name, ".936"); | |
std::string utf8_name = wstring2utf8(w_name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cassert> | |
#include <iomanip> | |
#include <fstream> | |
#include "single_include/nlohmann/json.hpp" | |
using namespace std; | |
using json = nlohmann::json; | |
// add snippnets here. |