Hasty Briefsbeta

How does Windows synthesize CF_Unicode­TEXT from CF_TEXT and vice versa?

10 days ago
  • #Clipboard
  • #Windows
  • #Text Conversion
  • Exploration of Windows clipboard text format conversions involving CF_UNICODETEXT, CF_TEXT, and CF_OEMTEXT.
  • Six possible conversions exist between three clipboard text formats, facilitated by the CF_LOCALE format which contains an LCID.
  • LCID encodes language, sublanguage, and sort rule details, but primarily used for deriving ANSI and OEM code pages.
  • Conversions between formats use specific code pages obtained from the LCID: LOCALE_IDEFAULTANSICODEPAGE for CF_TEXT and LOCALE_IDEFAULTCODEPAGE for CF_OEMTEXT.
  • A detailed chart summarizes the conversion methods between CF_TEXT, CF_OEMTEXT, and CF_UNICODETEXT, including functions like OemToAnsi, AnsiToOem, WC2MB, and MB2WC.
  • Questions raised about how CF_LOCALE is filled when CF_UNICODETEXT is set on the clipboard, hinting at future discussions.