I'm writing code that loops through a list of folder uri's and checks to make sure the folder actually exists on the file system. For folders that don't exist, the code will output the uri of the folder onto a webpage.
So, to the issue. The issue that I'm having is that some of the uri's of folders that are being output onto the webpage actually exist. For example, if I copy the uri from the webpage and paste it into File Explorer it locates the folder.
While investigating the issue, I put a breakpoint in the code and grabbed the suspect uri from the code and pasted it into the File Explorer and it couldn't find the folder. So when copying the uri from the webpage, File Explorer finds the folder but when copying the exact same uri from a watch variable in the code, File Explorer cannot find the folder. Below you'll find the uri's
URI of folder output onto webpage
\mycpu\go now\Harden, James Jr. & Allen\2021
Exact same URI but grabbed from watch variable in code
\mycpu\go now\Harden, James Jr. & Allen\2021
They're exactly the same. But then I tried pasting each one into chrome to see what I get, and here's what I got:
URI of folder output onto webpage and pasted into Chrome
file://mycpu//go%20now//Harden,%20James%20%20Jr.%20&%20Allen//2021/
Exact same URI but grabbed from watch variable in code and pasted into Chrome
file://mycpu//go%20now//Harden,%20James%C2%A0%20Jr.%20&%20Allen//2021/
So, as you can see above, the URI from the watch variable contains some non-breaking characters after the name James. What is the best way, in the code, to expose this underlying encoding so that the non breaking spaces can be removed?