Use is NSimSun this font, can display in the NotePad, CodePudding user response:
# include & lt; Windows. H> #include using namespace std; Int main () { Xf9 char szText []={0, 0 x66, 0 x0}; Would be szBuf [16]={0}; MultiByteToWideChar (szText CP_ACP, 0, 1, szBuf, _countof (szBuf)); WriteConsole (GetStdHandle (STD_OUTPUT_HANDLE), szBuf, sizeof (would) * (wcslen (szBuf)), NULL, NULL); return 0; } CodePudding user response:
This word what im typing, I try to switch to UNICODE is not 3 bytes Char szText [16]={x98 x98 0, 0 x39, 0, 0 x31, 0}; WCHAR us [4]={0}; Int len=MultiByteToWideChar (54936, 0, szText, 1, us, _countof (us)); CodePudding user response:
Look at the problem of the building Lord, I suddenly thought of kong yiji, there are four Hui words spelled... If these extremely cold and don't focus on common knowledge (the word is likely to be someone I hadn't seen throughout his life and let alone used), the progress will be slow CodePudding user response:
Fyi: # pragma comment (lib, "user32") # pragma comment (lib, "gdi32") #include #include #include #include Extern "C" HWND WINAPI GetConsoleWindow (); Void HideTheCursor () { CONSOLE_CURSOR_INFO cciCursor; HANDLE hStdOut=GetStdHandle (STD_OUTPUT_HANDLE); If (GetConsoleCursorInfo (hStdOut, & amp; CciCursor)) { CciCursor. BVisible=FALSE; SetConsoleCursorInfo (hStdOut, & amp; CciCursor); } } Void ShowTheCursor () { CONSOLE_CURSOR_INFO cciCursor; HANDLE hStdOut=GetStdHandle (STD_OUTPUT_HANDLE); If (GetConsoleCursorInfo (hStdOut, & amp; CciCursor)) { CciCursor. BVisible=TRUE; SetConsoleCursorInfo (hStdOut, & amp; CciCursor); } } Int main () { The HWND HWND; HDC HDC. HFONT HFONT; Would the wc [2]; System (" color F0 "); System (" CLS "); HideTheCursor (); HWND=GetConsoleWindow (); HDC=GetDC (HWND); Hfont=CreateFont (48,0,0,0,0,0,0,0, GB2312_CHARSET, 0,0,0,0, "song typeface - founder large character set"); SelectObject (HDC, hfont); Wc [0]=0 xd854u; Wc [1]=0 xdc00u; TextOutW (HDC, 10, 10, wc, 2); DeleteObject (hfont); ReleaseDC (HWND, HDC); getch(); 07 system (" color "); System (" CLS "); ShowTheCursor (); return 0; } # if 0 Paragraphs agent or broker for a pair of common represent the 16-bit Unicode value of a single character, to remember the key point is: Agent for is actually a 32-bit single characters, can no longer assume a 16-bit Unicode value is mapped to a character, Use a proxy item for Agent of the first value is high, contain between U + D800 to U + DBFF 16-bit code values, within the scope of the The item to the second value is low agent, containing between U + DC00 to U + DFFF range value, through the use of the agent on, 16-bit Unicode system can already defined by the Unicode standard of more than one hundred other characters to addressing (220), In the passed to XmlTextWriter method agent can be used in any string of characters, however, agent of the characters in writingShould be effective in the XML, for example, the world wide web consortium (W3C) recommendations are not allowed to use in the name of the element or attribute agent character, If the string contains invalid agent on, will cause abnormal, In addition, you can use WriteSurrogateCharEntity write with the agent to the corresponding character entities, character entities to 16 Generate hexadecimal format to write, using the following formula: (highChar xd800 0) * 0 x400 + (lowChar - 0 xdc00) + 0 x10000 If the string contains invalid agent on, an exception is thrown, the following example shows the proxy methods to WriteSurrogateCharEntity as input, C # copy //The following line writes & amp; # x10000. WriteSurrogateCharEntity (' \ uDC00 ', '\ uD800'); The following sample generates an agent to file, loads it into the XmlReader, with the new filename to save the file, Then, the original file and the new file is loaded back to the application of the XML document object model (DOM) structure in order to compare, C # copy Char lowChar highChar; Char [] charArray=new char [10]. FileStream targetFile=new FileStream (" SurrogatePair. XML, " FileMode. Create, FileAccess ReadWrite, FileShare. ReadWrite); LowChar=the Convert. ToChar (0 xdc00); HighChar=the Convert. ToChar (0 xd800); XmlTextWriter tw=new XmlTextWriter (targetFile, null); Tw. Formatting=Formatting. Indented; Tw. WriteStartElement (" root "); Tw. WriteStartAttribute (" test ", null); Tw. WriteSurrogateCharEntity (lowChar highChar); LowChar=the Convert. ToChar (0 xdc01); HighChar=the Convert. ToChar (0 xd801); Tw. WriteSurrogateCharEntity (lowChar highChar); LowChar=the Convert. ToChar (0 XDFFF); HighChar=the Convert. ToChar (0 XDBFF); nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull