Prepare the serverProgramUse Unicode to write
When compiling Ace, I added
# Define ace_has_wchar
# Define ace_use_wchar
Write a hello World applet. The result is displayed on the console that no Chinese characters are displayed. Soon, it is found that the console attribute must be set before Unicode characters can be properly displayed.
CodeAs follows:
Include "stdafx. H"
# Include "ACE/OS. H"
# Include "ACE/log_msg.h"
# Include <mmsystem. h>
# Include <locale. h>
Int _ tmain (INT argc, _ tchar * argv [])
{
Setlocale (lc_all, "CHS"); // ******* set local attributes ********** for (INT I = 0; I <100; I ++)
{
Int cur = ace_ OS: gettimeofday (). msec ();
_ Tprintf (ace_text ("Hello world, are you Unicode today? [% D]/n "), cur );
Outputdebugstr (ace_text ("Hello world, are you Unicode today? /N "));
Ace_debug (lm_info, ace_text ("Hello Ace, are you Unicode today? /N ")));
Ace_ OS: Sleep (1 );
}
Return 0;
}