ENGINE PLUGIN: Clipboard v0.4

Started by Snarky, Fri 30/03/2018 14:09:23

Previous topic - Next topic

Baguettator

Ow...  :~(

If someone is going to update it, I will be grateful :)

Crimson Wizard

#21
Quote from: Snarky on Sun 26/05/2024 06:33:50Converting the strings to and from Unicode falls outside the plugin scope, I think (I have some notion that the Windows clipboard itself is responsible for converting between compatible formats), but the plugin might either provide two versions of the Copy/Paste functions, or if there is an API for it, detect whether AGS is using Unicode mode.

I mean, you would have to convert to UTF-8 strings anyway if you want engine to understand your text, because widestring WinAPI uses Unicode-16 format.

In WinAPI utf-8 strings are called "multibyte" strings, and it provides conversion functions for getting utf-8 from widestrings.

EDIT: alternatively, there's a platform-independent way, like we have in the engine:
https://github.com/adventuregamestudio/ags/blob/860a4d1319ba76cfba1b3fdb52fcc64e1fe92d18/Common/util/string_utils.cpp#L317-L327
https://github.com/adventuregamestudio/ags/blob/860a4d1319ba76cfba1b3fdb52fcc64e1fe92d18/Common/util/utf8.h#L86

SMF spam blocked by CleanTalk