Skip to content

Instantly share code, notes, and snippets.

@ambar
Created August 2, 2018 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambar/c5c79a9ecde4f30336016170cac569c3 to your computer and use it in GitHub Desktop.
Save ambar/c5c79a9ecde4f30336016170cac569c3 to your computer and use it in GitHub Desktop.
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