Created
March 26, 2012 03:01
-
-
Save musubu/2202583 to your computer and use it in GitHub Desktop.
escape and unescape in node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var querystring = require('querystring'); | |
var original = 'http://example.com/product/abcde.html'; | |
var escaped = querystring.escape(original); | |
console.log(escaped); | |
// http%3A%2F%2Fexample.com%2Fproduct%2Fabcde.html | |
var unescaped = querystring.unescape(escaped); | |
console.log(unescaped); | |
// http://example.com/product/abcde.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment