What happen if you simply try using: script = clipboard.text instead of script = clipboard.formatdata
Leaving the rest as it is. Best, Scuri Em seg., 4 de mai. de 2020 às 13:41, Jane Taubman <janetaub...@gmail.com> escreveu: > I'll try to explain in a clearer way. > > If I open a file saved in UTF-16 in Lua using the IO library. I can then > handle the content of that file to convert each pair of bytes as needed to > end up with UTF-8 or even Ascii. All I want to do is to be able to read in > the text/html format from the clipboard and process it in lua. > > However I can not do anything with the Light user Data returned from the > Clipboard using Lua, that I can discover. > > > > On Sun, 3 May 2020 at 21:56, Andrew Robinson <arobinso...@cox.net> wrote: > >> I hate to state the obvious but in a string data type, an >> ASCII "character" is one byte in size (char), and a UTF-16 "character" is >> two bytes in size (short). >> >> I apologize if this is out-of-place for your conversation, but I get a >> lot of people who confuse a string character with a byte, instead of a >> variable number of bytes, but ... you know, just in case that is the real >> issue here I wanted to "fix it". >> >> So I'm not sure whether to say de nada or lo siento, >> Andrew >> >> On 2020-05-03 at 12:02 PM, Antonio Scuri <antonio.sc...@gmail.com> wrote: >> >> > The UTF-16 function takes a "string" >> >> That is weird. UTF-16 strings are *unsigned short** arrays, strings in >> Lua are *char** arrays. Something is not right. >> >> Is there a link for the documentation of that library? >> >> Best, >> Scuri >> >> >> Em dom., 3 de mai. de 2020 às 09:02, Jane Taubman <janetaub...@gmail.com> >> escreveu: >> >>> > "data" can not be converted to a string using "tostring". It must >>> use this function you mentioned. >>> >>> Sorry I did not make myself clear. The UTF-16 function takes a >>> "string" and will not work with a "light user data" so I need to know how >>> to convert the light user data from the iup.clipboard to a string using >>> just lua. >>> >>> >>> -- >>> Jane. >>> >>> Jane Taubman | www.rjt.org.uk | www.taubman.org.uk | www.fhug.org.uk >>> _______________________________________________ >>> Iup-users mailing list >>> Iup-users@lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/iup-users >>> >> >> _______________________________________________ >> Iup-users mailing list >> Iup-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/iup-users >> > > > -- > Jane. > > Jane Taubman | www.rjt.org.uk | www.taubman.org.uk | www.fhug.org.uk > _______________________________________________ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users >
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users