Skip to content

Utf8 converter, recursive converting for deep type such as Object and Array, will auto detect if it is encoded

License

Notifications You must be signed in to change notification settings

roren15/utf8-deep-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

utf8-deep-converter

Utf8 converter, convert recursively for deep type such as Object and Array

npm install utf8-deep-converter

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

About

Utf8 converter, recursive converting for deep type such as Object and Array, will auto detect if it is encoded

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published