Quick actions

cmd+k|ctrl+k

Navigation

Languages

中文<=>unicode<=>utf-8

Snippet info

Language

JavaScript

Visibility

public

Author

pheker

Created

2017-11-19T07:16:59Z

Updated

2017-11-20T11:33:11Z



let UNICODE = require("./tria.js");
let UTF8 = require("./dio.js");

let str = "he,βγ,你好,にほ,네이,龠龥";
console.log("str: "+str);

let unicode = UNICODE.encode(str)
console.log("unicode: "+unicode)

let utf8 = UTF8.encode(unicode);
console.log("utf8: "+utf8);

let unicode2 = UTF8.decode(utf8);
console.log("unicode: "+unicode2);

let str2 = UNICODE.decode(unicode2);
console.log("str: "+str2)

console.log(`

=====================我是风骚的分隔线^_^==========================

`);

let $str = "he,βγ,你好,にほ,네이,龠龥";
console.log("str: "+str);

let $utf8 = UTF8.str2utf8($str);
console.log("utf8: "+utf8);

let $$str = UTF8.utf82str($utf8);
console.log("str: "+$$str);



INFO