Guest User

Untitled

a guest
Jul 10th, 2021
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. wchar_t *convertCharToWChar(const char *charArray) {
  2.     wchar_t *wString = new wchar_t[4096];
  3.     MultiByteToWideChar(CP_UTF8, 0, charArray, -1, wString, 4096);
  4.     return wString;
  5. }
  6.  
  7. /////
  8.  
  9.  
  10. wchar_t * getTranslateText(string text) {
  11. .....
  12. .....
  13.  json responseJson = json::parse(r.text);
  14.     string txt = responseJson.at("text")[0];
  15.     wchar_t *wText = convertCharToWChar(txt.c_str());
  16. return wText ;
  17. }
  18.  
  19. /////
  20.  
  21.     wchar_t *translateText = getTranslateText(outText);
  22.     wcout << translateText << endl;
Advertisement
Add Comment
Please, Sign In to add comment