grunt-iconv
Advanced tools
Comparing version
{ | ||
"name": "grunt-iconv", | ||
"description": "change file encoding", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"homepage": "https://github.com/amdgigabyte/grunt-iconv", | ||
"author": { | ||
"name": "乔福", | ||
"name": "amdgigabyte", | ||
"email": "amdgigabyte@gmail.com", | ||
@@ -9,0 +9,0 @@ "url": "http://zipeng.info" |
@@ -22,61 +22,12 @@ # grunt-iconv | ||
### Overview | ||
In your project's Gruntfile, add a section named `iconv` to the data object passed into `grunt.initConfig()`. | ||
```js | ||
grunt.initConfig({ | ||
iconv: { | ||
options: { | ||
// Task-specific options go here. | ||
}, | ||
your_target: { | ||
// Target-specific file lists and/or options go here. | ||
}, | ||
}, | ||
}) | ||
``` | ||
### Options | ||
#### options.separator | ||
Type: `String` | ||
Default value: `', '` | ||
A string value that is used to do something with whatever. | ||
#### options.punctuation | ||
Type: `String` | ||
Default value: `'.'` | ||
A string value that is used to do something else with whatever else. | ||
### Usage Examples | ||
#### Default Options | ||
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.` | ||
```js | ||
grunt.initConfig({ | ||
iconv: { | ||
options: {}, | ||
files: { | ||
'dest/default_options': ['src/testing', 'src/123'], | ||
}, | ||
}, | ||
}) | ||
``` | ||
#### Custom Options | ||
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!` | ||
```js | ||
grunt.initConfig({ | ||
iconv: { | ||
options: { | ||
separator: ': ', | ||
punctuation: ' !!!', | ||
from_charset:"gbk", | ||
to_charset:"utf8" | ||
}, | ||
files: { | ||
'dest/default_options': ['src/testing', 'src/123'], | ||
}, | ||
src: ['<%= buildDir+timeStamp %>**/*.js'] | ||
}, | ||
@@ -83,0 +34,0 @@ }) |
9701
-11.52%41
-54.44%