I know this is a fairly old unsolved thread (the so-called solution that was provided by a Microsoft support engineer was not a solution although it was marked as "accepted"), but I finally managed to solve it and I wanted to share the solution I found.
Actually, the solution I am proposing here is solving three commonly reported issues about OneDrive: (1) characters like "," or "&" in the file names being replaced by "^J" and "^O" respectively; (2) the location of the OneDrive folder in "C:\Users\UserName\OneDrive"
creates longer paths that eventually causes a problem when the total path reaches 260 characters or more; and (3) in some older applications, the OneDrive folder is not directly accessible and one has to navigate from the root of C: through Users, etc. in
order to reach the OneDrive folder (at least when "Save documents to OneDrive by default" is not enabled in PC settings).
In order to solve all three above issues, one simply has to map a substitute (SUBST) drive for the OneDrive folder (or any deeper folder for that matter). To make the solution seamless and persistent, one should also force the SUBST mapping to be persistent
across reboots by adding the following string value to the registry using RegEdit:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"O Drive"="subst O: "C:\Users\UserName\OneDrive""
making sure to replace UserName with the appropriate user name. Also, another letter can be used in case the O: drive is already taken. Lastly, if entering the command manually in the registry, do not double the backslashes and do not escape the quotation
marks with the backslash in that case (in other words, simply enter the string as: subst O: "C:\Users\UserName\OneDrive").
I have been opening from and saving documents to my O: drive (instead of OneDrive) for a few days now and I did not experience any problem. My files are still perfectly accessible online or on my other devices and I do not experience the above issues
anymore. It did some resynchronisation for a while (I am not sure why, but I had over 1.3 GB of data in my OneDrive), but after that period, everything was fine.
Hope this helps.