I have a debugging tool which logs data from a serial port. The data is a mixture of text descriptions and actual data bytes. The data bytes are not text, often can’t be displayed as text. Xojo can however store those bytes in a string, which is what I do. I have a string array myDebugLog() which contains all the messages. The problem comes when I want to copy this to the clipboard. I use the following code:
dim L as string = DefineEncoding( join( myDebugLog(), EndOfLine ), Encodings.UTF8 )
dim c as new Clipboard
c.SetText( L )
It doesn’t work. I’m sure the data goes to the clipboard, but apparently because it contains non-text bytes, when I go to paste it into a text editor, there’s nothing there. I know I can use a clipboard utility or look at the data in the IDE, but this is for users of my software to be able to send me their debug logs if they need to. Any ideas how to get this to work? I also tried:
c.AddRawData( L, "public.utf8-plain-text" )
Same result.