outputEncoding.coffee 312 B

123456789101112
  1. helloWorld = () -> console.log phantom.outputEncoding + ": こんにちは、世界!"
  2. console.log "Using default encoding..."
  3. helloWorld()
  4. console.log "\nUsing other encodings..."
  5. for enc in ["euc-jp", "sjis", "utf8", "System"]
  6. do (enc) ->
  7. phantom.outputEncoding = enc
  8. helloWorld()
  9. phantom.exit()