Greasy Fork

Shined up real nice.

encodeToGb2312

转码 GB2312

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://greasyfork.org/scripts/368137-encodetogb2312/code/encodeToGb2312.js?version=601683

Advertisement
Author
Ziyuan Ruan
Ratings
1 0 0
Version
0.0.1.20180602124305
Created
Updated
License
N/A
Applies to
All sites

Author's Description

This code is from https://github.com/liuxiaodong/encodeToGb2312

You can use like:

var result = encodeToGb2312("字符串转GB2312");
result:  D7D6B7FBB4AED7AA474232333132
var result = encodeToGb2312("字符串转GB2312",true);
result:  %D7%D6%B7%FB%B4%AE%D7%AA%47%42%32%33%31%32