Closed stephenrobertson0 closed 7 years ago
So this is interesting because the +
character is allowed in the path segment of a URI by RFC3986 which are the rules we follow for encoding, but it appears that CouchDB (incorrectly IMO) follows the x-www-form-urlencoded
practice of converting a +
into a space. At best I think that should only apply in a query segment, not a path segment. I'll need to investigate whether this might get fixed on the CouchDB side, but because of backwards compatibility that seems unlikely and we may need to break with the URI spec and workaround.
Given that issue has been open since 2012 I think we probably ought to just workaround the issue.
When using com.cloudant.client.api.Database.find() and there is a "+" in the document id, the document does not get returned. It seems like the "+" is not getting URL encoded into "%2B", but other characters seem to be encoded correctly.
Using cloudant client 2.2.0, Sun Java 8, not using okhttp.
Code example:
database.find(Document.class, "id12+34");