| 1 | "use strict"; |
| 2 | function helloWorld() { |
| 3 | console.log(phantom.outputEncoding + ": こんにちは、世界!"); |
| 4 | } |
| 5 | |
| 6 | console.log("Using default encoding..."); |
| 7 | helloWorld(); |
| 8 | |
| 9 | console.log("\nUsing other encodings..."); |
| 10 | |
| 11 | var encodings = ["euc-jp", "sjis", "utf8", "System"]; |
| 12 | for (var i = 0; i < encodings.length; i++) { |
| 13 | phantom.outputEncoding = encodings[i]; |
| 14 | helloWorld(); |
| 15 | } |
| 16 | |
| 17 | phantom.exit() |