Created
August 2, 2018 09:51
-
-
Save ambar/c5c79a9ecde4f30336016170cac569c3 to your computer and use it in GitHub Desktop.
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
const iconv = require('iconv-lite') | |
const querystring = require('querystring') | |
const parseGBKQueryString = string => { | |
return querystring.parse(string, null, null, { | |
decodeURIComponent: v => { | |
return iconv.decode(Array.from(unescape(v)).map(c => c.codePointAt()), 'gbk') | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment