Hi,

  That was a bug. FORMATDATA is not a string, and it was being returned as
a string. Thanks for pointing that out. Just fixed and committed to the SVN.

  As a workaround you can do:

script = iup.GetAttributeData(clipboard, "FORMATDATA")

  It will be returned as a light user data. Then you can use your
conversion functions.

Best,
Scuri


Em ter, 25 de jun de 2019 às 05:18, Jane Taubman <janetaub...@gmail.com>
escreveu:

> I am using
> Lua 5.3
> IUP 3.26
>
> I am trying to get the HTML text from the clipboard using
>
> require "iuplua"
>
> local clipboard = iup:clipboard()
> local script
> clipboard.format = 'text/html'
>
> if clipboard.formatavailable == 'YES' then
>    script = clipboard.formatdata
>    print(clipboard.FORMATDATASIZE)
>    print(#script,script)
> end
>
> When I run the above the formatdata size returns 64, but my script string
> terminates at the first null what appears to be a UTF-16 HTML string.
>
> How do I get the whole contents back from the clipboard please,  I have a
> function to convert UTF-16 to UTF-8 if I can get the whole string back to a
> variable.
>
> --
> 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

Reply via email to