How to stop Windows 10 Calculator from enclosing copied text in 202D and 202C Unicode characters?

If I use Windows 10 calculator to copy one of its produced values:

windows 10 calculator

What it copies to the clipboard is text enclosed in these two Unicode characters:

actual text output

'LEFT-TO-RIGHT OVERRIDE' (U+202D) on the left, and 'POP DIRECTIONAL FORMATTING' (U+202C) on the right.

These mess me up if I paste it into my destination program that expects only the ASCII text (like a programming language editor.)

So I was wondering, if there's a setting to prevent Calculator from adding those characters?


Solution 1:

I don't know why those characters are there. But you can easily get rid of it by copying from the result text box instead of from the conversion outputs

For example if you want the binary value, click the BIN line to make the output changes to binary then copy

calculator example

Of course this is just a workaround until there's a solid solution


Update:

In the current version (10.1907.24.0) if you right click directly on the number like the screenshot above then a context menu with "Select All" will be shown. To get Copy/Paste you must right click anywhere outside the number box

The issue has been reported in Calculator's repo: Copy paste result contains hidden character. Those characters have been specified as "by design"

Talked with @joshkoon offline and we think we can be smarter about when we include the extra hidden characters. Assigning to @joseartrivera to either fix this or, if we cannot remove the characters, close out bug as by design.

https://github.com/microsoft/calculator/issues/504#issuecomment-514437227


Update 2:

The issue has been fixed in this pull request. Checked with Calculator 10.2004.23.0 on my PC and no U+202C/202D characters anymore