I'm working on an internal production tool for our company. And for that I need to compare some local files inside the Dropbox folder with the files synced to Dropbox (to at least try to prevent som race conditions working with InDesign and the lock-files created by it).
And then I use the path info from ~/.dropbox/info.json to get at which path the team folder is mounted.
But I encounter a problem when using the path because there seems to be some differences between how Dropbox parses special characters and how macOS treats them.
In our case it's "ö" – parsed as "o\u0308" in info.json, but I'm guessing there might be some trouble with similar characters such as "å", "ä" or "ü". And if I want to distribute this to a larger crowd I have to account for this.
When I compare the the specific charachters retrieved using String.prototype.charCodeAt(), the difference get clear:
OS path: charCode 111
Dropbox path: charCode 246
And in the file the name of our company is "Sjo\u0308fartstidningen".
Maybe it's Dropbox, or maybe this has something to do with how javascript parses "o\u0308", I don't now. I just did JSON.parse(content) after retrieving the content of info.json using fs.readFile(path, 'utf8'). Has anyone else encountered this? Does anyone know of a way to properly parse unicode charachters with Node? Or is there actually a difference between how Dropbox does this and how macOS does it?