Greasy Fork is available in English.

urlEncodeGBK.js

js纯代码实现gbk格式的url编码

Dette scriptet burde ikke installeres direkte. Det er et bibliotek for andre script å inkludere med det nye metadirektivet // @require https://update.greasyfork.org/scripts/427724/939166/urlEncodeGBKjs.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Forfatter
PYUDNG
Versjon
0.0.1.20210609184829
Lagd
09.06.2021
Oppdatert
09.06.2021
Size
589 kB
Lisens
I/T

urlEncodeGBK.js

js纯代码实现gbk格式的url编码

新增的全局方法:

encodeURI_GBKencodeURIComponent_GBK
encodeURIencodeURIComponent未改动,仍可使用

效果:

引用前:encodeURI('中文') >> "%E4%B8%AD%E6%96%87"
引用后:encodeURI_GBK('中文') >> "%D6%D0%CE%C4"

来源:http://www.vuln.cn/2901

相较于原代码,修改了函数名称,使原生encodeURIencodeURIComponent依然可用;将变量GBKTable声明为常量