Whoa there exists something Raymond Chen didn’t know about Windows core APIs?
whatever imagined problem is solved by marking clipboard text with some magical locale indicator is surely not as important as being able to interop literally just unicode characters between programs without having to read a 2-part blog post
Unicode-enabled Win32 applications can already do this as described in the article, the program pasting to the clipboard adds CF_UNICODETEXT format, and the program reading from the clipboard checks if CF_UNICODETEXT is available and prefers it over CF_TEXT.
The CF_LOCALE is used by the system to convert[1] CF_TEXT to CF_UNICODETEXT, so a Unicode-enabled application can get the right contents from a non-Unicode-enabled application.
[1]: https://learn.microsoft.com/en-us/windows/win32/dataxchg/sta...
The geniuses behind Unicode managed to make it mandatory anyways, at least if you want correct CJK text rendering :)
What I am supposed to use those days? HTML-encoded in utf-8, with lang attributes, so <span lang="ja-JA"> and <bdi lang="zh-Hans"> infested text?
That is also why Win32 seems to be the most stable API for userland programs, while constant recompiles of the entire userland are very much the norm and required so your desktop and apps can keep working on other *NIX.
string text = Clipboard.GetText();