Search code examples
cencodingwchar-tlpcwstr

Anybody know a non-ascii encoding?


'1' use two bytes 20 and 0; '2' use two bytes 21 and 0;

'a' use two bytes 68 and 0; 'b' use two bytes 69 and 0;

I'm hook func ExtTextOutW from GDI32.dll(windowsapi) ,and read from str(unsigned char); such as abc123... while got:68 0 69 0 70 0 20 0 21 0...;

BOOL ExtTextOutW
 (
  HDC         hdc,
  INT         x,
  INT         y,
  UINT        flags,
  const RECT* lprect,
  LPCWSTR     str,
  UINT        count,
  const INT*  lpDx
 )

Solution

  • when flags=0x10;

    The lpString array refers to an array returned from GetCharacterPlacement and should be parsed directly by GDI as no further language-specific processing is required. Glyph indexing only applies to TrueType fonts, but the flag can be used for bitmap and vector fonts to indicate that no further language processing is necessary and GDI should process the string directly. Note that all glyph indexes are 16-bit values even though the string is assumed to be an array of 8-bit values for raster fonts. For ExtTextOutW, the glyph indexes are saved to a metafile. However, to display the correct characters the metafile must be played back using the same font. For ExtTextOutA, the glyph indexes are not saved.