Page 1 of 1

Output to clipboard, and pasting into Excel - encoding issue

Posted: Thu Mar 11, 2010 10:17 pm
by AnthonyFitz
Hi Simon,

I'm creating a tool in VB that takes in user input and runs a textpipepro filter in command line mode which outputs to the clipboard. Then the tool silently opens up excel and pastes this data into a specific column.

Everything is working great except that its pasting corrupted characters for non english characters. They look like multibyte unicode characters that are not being converted correctly on the clipboard.

The filter works fine if outputed to a text file so I think it is not a problem with the filter.

Is there something I need to do to handle the clipboard contents differently to make it paste correctly?

Thanks.
Anthony.

Re: Output to clipboard, and pasting into Excel - encoding issue

Posted: Fri Mar 12, 2010 10:07 am
by DataMystic Support
Hi Anthony,

Currently, TextPipe will only grab ANSI text from the clipboard. If you have Unicode data on the clipboard then it will be converted silently to ANSI, and non-english characters will appear as gibberish.

We've just made a change to fix this. It's in the 8.5 beta - http://www.datamystic.com/textpipeprobeta.exe

You will need to add filters at the top and bottom of your filter list to convert incoming text from Unicode UTF16-LE to UTF-8, and UTF-8 to UTF16-LE. e.g.

|--Input from clipboard
| [X] Unicode input
|
|--Convert from UTF-16LE to UTF-8
|
|--Comment...
| handle normal string processing here
|
|--Convert from UTF-8 to UTF-16LE
|
+--Output to clipboard
[X] Unicode output

Re: Output to clipboard, and pasting into Excel - encoding issue

Posted: Fri Mar 12, 2010 8:31 pm
by AnthonyFitz
Perfect, thanks Simon!

Amazing, super fast support. Top Class!

Anthony.