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

Save files with BOM? #3

Closed
craigshoemaker opened this issue May 27, 2015 · 2 comments
Closed

Save files with BOM? #3

craigshoemaker opened this issue May 27, 2015 · 2 comments

Comments

@craigshoemaker
Copy link

Is the an option to save files with BOM?

@craigshoemaker
Copy link
Author

Well I just went and read the code and see that there is no option 😄. Perhaps if I have the time later I can provide a pull request.

@exos
Copy link
Owner

exos commented May 28, 2015

Library was created for easy dialogs usage on node-webkit. To save and read files it use the native node.js filesystem module as you can see in line 221 of lib/fdialog.js.

Content is sent throug a Buffer object (Node.js native) and it defines the encoding and staf. For easy2use reazons I have included the string, and encoding's method to save that. But you can create a Buffer and send it to saveFile method directly (just for binary formats).

There is an ISSUE on node adding UTF8 encoding with BOM here: nodejs/node-v0.x-archive#4039
And there is more here: nodejs/node-v0.x-archive#1918
Here is a tool for it: https://www.npmjs.com/package/iconv-lite

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

2 participants