I have a question, I am writing a program in c++
, in which I need to write unicode characters, but dynamically.
For example, with the following code, I write a text file with unicode characters:
#include <iostream>
#include <fstream>
int main(int argc, const char* argv[]){
std::string texto = "Texto con caracteres unicode \u0305";
std::ofstream salida("./archivo_de_salida.txt");
if(salida.is_open()){
//Escribo los datos
salida << texto;
}
salida.close();
return 0;
}
But... How can I write unicode characters dynamically? For example:
std::string code = "0305";
std::string caracter_unicode = "\u" + code;
Is that possible?