using JS sdk method paperDocsDownload({ doc_id, export_format: 'html' }) and certain character (m-dash, curly quotes) come thru as â.
The test document is here: https://paper.dropbox.com/doc/test-paper-doc-S7sSIlM2E0g6p3OXhhts4
Also the project I'm working on is here: https://github.com/bradoyler/paper2json
Thanks!
I was able to reproduce the issue. It looks like it is a matter of encoding it properly. You can do so like this:
new Buffer(doc.fileBinary, 'binary').toString()
I'll ask the team to look into whether or not the SDK should/can do that for you though.
more simple test: https://github.com/bradoyler/paper2json/blob/master/test/html.js
interestingly, I dont see the malformed html when I use the http api via:
curl -X POST https://api.dropboxapi.com/2/paper/docs/download \ --header "Authorization: Bearer xxyyzzzzzz" \ --header "Dropbox-API-Arg: {\"doc_id\": \"S7sSIlM2E0g6p3OXhhts4\",\"export_format\": \"html\"}"
Doh! You're right.
Proper way to do this in Node 6+ is like this:
Buffer.from(doc.fileBinary, 'binary').toString()
But yea, I can't think of a reason why an SDK user would want different behavior from the HTTP API.