When escaping strings, ensure that intermediate has appropriate encoding, so we don't double encode.
When escaping strings, ensure that intermediate has appropriate encoding, so we don't double encode.

jcoyne/rdf,ruby-rdf/rdf,ninjapanzer/rdf,PerfectMemory/rdf