fixed url encoding for slash switching emulation.

Fixes #8458