mirror of https://github.com/vitalif/phantomjs
Add examples for phantom.outputEncoding
parent
66460a7793
commit
b5bb07faa4
|
@ -0,0 +1,12 @@
|
|||
helloWorld = () -> console.log phantom.outputEncoding + ": こんにちは、世界!"
|
||||
|
||||
console.log "Using default encoding..."
|
||||
helloWorld()
|
||||
|
||||
console.log "\nUsing other encodings..."
|
||||
for enc in ["euc-jp", "sjis", "utf8", "System"]
|
||||
do (enc) ->
|
||||
phantom.outputEncoding = enc
|
||||
helloWorld()
|
||||
|
||||
phantom.exit()
|
|
@ -0,0 +1,16 @@
|
|||
function helloWorld() {
|
||||
console.log(phantom.outputEncoding + ": こんにちは、世界!");
|
||||
}
|
||||
|
||||
console.log("Using default encoding...");
|
||||
helloWorld();
|
||||
|
||||
console.log("\nUsing other encodings...");
|
||||
|
||||
var encodings = ["euc-jp", "sjis", "utf8", "System"];
|
||||
for (var i = 0; i < encodings.length; i++) {
|
||||
phantom.outputEncoding = encodings[i];
|
||||
helloWorld();
|
||||
}
|
||||
|
||||
phantom.exit()
|
Loading…
Reference in New Issue