sm plugin: URL encode query string