NO-BREAK SPACE ignored when setting as clipboard data

Ask general questions here.
David Zita
Posts: 30
Joined: Thu Mar 31, 2016 1:20 pm

NO-BREAK SPACE ignored when setting as clipboard data

Post by David Zita » Tue Dec 01, 2020 3:55 pm

I need to have some pre-defined clipboard contents, so I made a little utility that stores clipboard content into file. It stores only Text and HTML formats. Now, the utility can store and load clipboards from files. When I load it using my utility, it is loaded correctly (i.e. including this NO-BREAK SPACE U+00A0 when it's part of the clipboard). When I copy the same code into Ranorex and run it there, the U+00A0 character is ignored and that leads to some consequences (pasted text is then incorrectly displayed etc.)
I have been struggling with this for past few days, tried everything. I have verified, that even in Ranorex the value loaded from the file contains the no-brake space character, so the problem is when calling ClipBoard.SetData. In both projects I am using .NET 4.6.2, since Ranorex projects are 32bit, I set the SaveClipboard project also as 32bit. Still no success.

To reproduce the problem, download the SaveClipboard project. There's already a built version. Syntax is:

Code: Select all

SaveClipboard.exe -i html.json
to import stored clipboard, or

Code: Select all

SaveClipboard.exe -e html.json
to export clipboard to json file.
If you import the attached html.json (in the bin folder in SaveClipboard.zip) you should get correct content into clipboard (a text "new Microsoft" where there is the no-brake space between the two words.
If you import from the same file using the same code but inside Ranorex project, it skips the no-brake space.
You can easily check the content of you clipboard using https://freeclipboardviewer.com/. Or just paste the clipboard into Word. If it's correct, there is a space between two words. If it's from Ranorex, there is no space (see the images).
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: NO-BREAK SPACE ignored when setting as clipboard data

Post by Support Team » Fri Dec 04, 2020 7:05 pm

Hi!

Please contact us via the links below and we will be more than happy to further assist you with this! If you do contact us, please include a link to this thread so we can provide the solution once found.

Kind Regards,
Ranorex Team

David Zita
Posts: 30
Joined: Thu Mar 31, 2016 1:20 pm

Re: NO-BREAK SPACE ignored when setting as clipboard data

Post by David Zita » Mon Dec 21, 2020 1:39 pm

Hi, I have created an issue as you suggested, it's been a 2 weeks now and no answer (except for the automatic one). My case ID is 00865404. Can someone check it please? Thank you.

David Zita
Posts: 30
Joined: Thu Mar 31, 2016 1:20 pm

Re: NO-BREAK SPACE ignored when setting as clipboard data

Post by David Zita » Wed Mar 03, 2021 12:38 pm

Conclusion:
After communicating with Ranorex team, we have found out that it's probably something in my environment. If I try it on fresh new system it works as expected. On my system, it only works when I run the test suite. If try just one recording module, the mentioned bug appears.