utf8-deep-converter
v0.1.3
Published
Utf8 converter, convert recursively for deep type such as Object and Array
Downloads
2
Maintainers
Readme
utf8-deep-converter
Utf8 converter, convert recursively for deep type such as Object and Array
1. Install
$ npm install --save utf8-deep-converter
2. Usage
const converter = require('utf8-deep-converter')
converter.utf8DeepEncode({obj:'可以',数组:['也','可以'],normal:'pass'}) //utf8 encode
// {"obj":"å¯ä»¥","normal":"pass","æ°ç»":["ä¹","å¯ä»¥"]}
converter.utf8DeepDecode({"obj":"å¯ä»¥","normal":"pass","æ°ç»":["ä¹","å¯ä»¥"]}) //utf8 decode
// {"obj":"可以","normal":"pass","数组":["也","可以"]}
3. Api
Init
const converter = require('utf8-deep-converter')
Function
converter.utf8DeepEncode()
encode utf8 type data
|arguments|required|description| |:------:|:------:|------| |obj|true|recursive encode, auto passing normal type|
converter.utf8DeepDecode()
decode utf8 type data
|arguments|required|description| |:------:|:------:|------| |obj|true|recursive encode, auto passing normal type|