Testing for extended unicode?
#2
What you're tying to do is not possible in current QB64 versions. QB64 uses the flag CF_TEXT in its _CLIPBOARD$ commands, i.e. even if you copy unicode from some other program into the clipboard you won't get it back as is. The OS knows it currently has unicode in the clip, but QB64 requests to get out regular ansi text (CF_TEXT instead of CF_UNICODETEXT), so the OS goes and internally converts the clip contents to fit the ansi type requested by QB64.

I had the same problem when doing some automation to maintain our Wiki via clipboard, but it constantly messed up any extended ASCII characters.

I'll make an issue at github for it, for a quick fix you could go into file "internal/c/libqb.cpp" looking for the "sub__clipboard" and "func__clipboard" and in that sub/functions replace all occurrences of CF_TEXT with CF_UNICODETEXT and save the file.

After that start the IDE and select the entry "Purge C++ libraries" from the "Debug" menu. After that recompile your program and it should work with unicode text.

BUT ATTENTION: Unicode on the clipboard does usually mean you work with wide chars, not ASCII anymore, i.e. encoding is now UTF-16 (little endian).

Maybe Zak (@Balderdash) can give you more info on that, it's probably easier/safer to use direct WinAPI calls, than messing with QB64 internals.
Reply


Messages In This Thread
Testing for extended unicode? - by tothebin - 03-23-2023, 06:01 AM
RE: Testing for extended unicode? - by RhoSigma - 03-23-2023, 08:29 AM
RE: Testing for extended unicode? - by tothebin - 03-23-2023, 09:48 PM
RE: Testing for extended unicode? - by mnrvovrfc - 03-24-2023, 01:13 AM
RE: Testing for extended unicode? - by tothebin - 03-24-2023, 02:15 PM
RE: Testing for extended unicode? - by RhoSigma - 03-24-2023, 04:43 PM
RE: Testing for extended unicode? - by tothebin - 03-24-2023, 10:01 PM
RE: Testing for extended unicode? - by mnrvovrfc - 03-24-2023, 10:26 PM
RE: Testing for extended unicode? - by tothebin - 03-24-2023, 10:43 PM



Users browsing this thread: 5 Guest(s)