0

When testing my test c++ code, the English and Chinese characters are displayed correctly, but the Thai characters lead to ???. I am using Visual Studio as IDE.

This is my code

#include <iostream>
using namespace std;

int main()
{
    std::cout << "Hello World!\n";
    cout << "ยบางนา-ตราด 25 แขวงบางนาเหนือ 10260 บางนา กรุงเทพฯ 我爱北京天安门" << endl;
}

Here is the result

Hello World!
??????-???? 25 ?????????????? 10260 ????? ???????? 我爱北京天安门

enter image description here

DHsong
  • 19
  • 1
  • Does this answer your questions? https://stackoverflow.com/questions/2849010/output-unicode-to-console-using-c-in-windows – Jacob Feb 18 '20 at 11:33
  • Use L “ ...” for this with wcout. – Arundeep Chohan Feb 18 '20 at 11:39
  • when i use wcout << L"ยบางนา-ตราด 25 แขวงบางนาเหนือ 10260 บางนา กรุงเทพฯ 我爱北京天安门 de: ĐĄßĞĝ" << endl; There is nothing display in console – DHsong Feb 18 '20 at 11:45
  • Welcome to SO! I edited your question for you. Please refer to [the guidelines](https://stackoverflow.com/help/how-to-ask) next time. – B--rian Feb 18 '20 at 11:55

1 Answers1

0

I found the answer.

https://blog.csdn.net/longyanbuhui/article/details/104019268

this method solve my question.

DHsong
  • 19
  • 1