1cco
12/15/2015 - 7:47 AM

Convert to Single/Multi-byte charactors


if (!String.toSingleByte) {
	String.prototype.toSingleByte = function () {
		return this.replace(/[A-Za-z0-9]/g, function(s)
		{
			return String.fromCharCode(s.charCodeAt(0) - 0xFEE0);
		});
	};
}
if (!String.toMultiByte) {
	String.prototype.toMultiByte = function () {
		return this.replace(/[A-Za-z0-9]/g, function(s)
		{
			return String.fromCharCode(s.charCodeAt(0) + 0xFEE0);
		});
	};
}