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

Update ejs.js #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update ejs.js #168

wants to merge 1 commit into from

Conversation

enowit
Copy link

@enowit enowit commented Apr 18, 2014

identify and remove BOM header.

new function:
line = 52

/**

  • Render an EJS file at the given path (easton changed)
  • @param {String} path
  • @param {String} encoding
  • @api private
    */
    function readEJSFile(path, encoding) {
    var buffer = read(path);
    if (buffer[0] == 239 && buffer[1] == 187 && buffer[2] == 191) {
    buffer = buffer.slice(3);
    }
    return buffer.toString(encoding);
    }

Able to identify and remove BOM header.

new function:
line = 52

/**
 * Render an EJS file at the given `path` (easton changed)
 * @param {String} path
 * @param {String} encoding
 * @api private
*/
function readEJSFile(path, encoding) {
    var buffer = read(path);
    if (buffer[0] == 239 && buffer[1] == 187 && buffer[2] == 191) {
        buffer = buffer.slice(3);
    }
    return buffer.toString(encoding);
}
@matthewhadley
Copy link

Is this the same as this rejected PR in express-handlerbars? ericf/express-handlebars#77 (comment)

@enowit
Copy link
Author

enowit commented Sep 23, 2014

I submitted a update, in Apr. but nobody reply.

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

Successfully merging this pull request may close these issues.

2 participants