Permalink
Browse files

set encoding in readFile to get string instead of buffer

  • Loading branch information...
1 parent 059ec7d commit a8f3a93159ffba9996a700b74eac59062ac0ed34 @rachel-carvalho rachel-carvalho committed Sep 4, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/cli.coffee
View
@@ -10,10 +10,10 @@ options = null
handle_error = (err) -> console.log err.stack if err
render = (input_path, output_directory) ->
- fs.readFile input_path, (err, contents) ->
+ fs.readFile input_path, 'utf-8', (err, contents) ->
handle_error err
try
- html = coffeekup.render String(contents), options
+ html = coffeekup.render contents, options
write input_path, html, output_directory
catch err
handle_error err
@@ -57,8 +57,8 @@ switches = [
if options.utils
options.locals ?= {}
options.locals.render = (file) ->
- contents = fs.readFileSync file
- coffeekup.render String(contents), options
+ contents = fs.readFileSync file, 'utf-8'
+ coffeekup.render contents, options
if args.length > 0
file = args[0]

0 comments on commit a8f3a93

Please sign in to comment.