Skip to content
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

Closed
yocontra opened this issue Jun 10, 2014 · 10 comments
Closed

encoding param #23

yocontra opened this issue Jun 10, 2014 · 10 comments

Comments

@yocontra
Copy link
Member

should work on src and dest, default being utf8

@czbo
Copy link

czbo commented Mar 30, 2015

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...

@czbo
Copy link

czbo commented Mar 31, 2015

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')) });

@phated
Copy link
Member

phated commented Jan 12, 2016

@contra do you have any thoughts on how to implement this?

@yocontra
Copy link
Member Author

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.

@phated
Copy link
Member

phated commented Jan 12, 2016

maybe vinyl should have an encoding property that plugins like gulp-concat could check and emit an error if they see different encodings?

@phated
Copy link
Member

phated commented Jan 28, 2016

@contra any thoughts on my comment above?

@phated
Copy link
Member

phated commented Jun 12, 2017

What does this API look like? Was thinking about implementing with iconv-lite which would give us a stripBOM replacement too but I don't have a good sense of how this works.

@phated phated removed this from the Future milestone Apr 28, 2020
@phated
Copy link
Member

phated commented Apr 28, 2020

@contra I'm thinking we should consider shipping the encoding support that Erik already has completed in #287

@yocontra
Copy link
Member Author

@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?

@phated
Copy link
Member

phated commented Apr 30, 2020

I'd be more comfortable releasing it in the major to avoid any weird edge cases we haven't considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants