-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
encoding param #23
Comments
I am currently trying to use gulp.src to read and transform html files with Chinese (big5) characters into utf8 encoding. Doesn't seem completely straight forward; still trying to figure it out... |
Follow up to my own comment yesterday: I am able to figure out how to read in a file with big5 encoding and output to utf8 encoding. It doesn't work if I simply specify {encoding: 'utf8} in the .dest function; I need to use convertEncoding to process the Stream and then do other things. It seems to work the same even if the option {encoding:'big5'} is omitted in the .src function. var convertEncoding = require('gulp-convert-encoding'); gulp.task('encode', function () { return gulp.src('app/*_/_.html',{encoding: 'big5'}) .pipe(convertEncoding({from: 'big5', to: 'utf8'})) .pipe(gulp.dest('.tmp')) }); |
@contra do you have any thoughts on how to implement this? |
Haven't looked into it yet - one thing to keep in mind is concating files of multiple encodings together. I've been wrangling with some issues in gulp-concat about that. |
maybe vinyl should have an encoding property that plugins like gulp-concat could check and emit an error if they see different encodings? |
@contra any thoughts on my comment above? |
What does this API look like? Was thinking about implementing with |
@phated I agree - the PR looks good to me and seems like a minor release which is nice. Is the only outstanding item to propagate the new option docs to the main docs? |
I'd be more comfortable releasing it in the major to avoid any weird edge cases we haven't considered. |
should work on src and dest, default being utf8
The text was updated successfully, but these errors were encountered: