Error phantomjs outputEncoding.js

Phantomjs example outputEncoding.js does not display the correct characters (Danish characters) ...

I am running phantomjs 1.7 on windows.

(This worked when I ran phantomjs 1.4 on linux, but also threw an error on Linux after updating version 1.8.2)

outputEncoding.js:

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(); 

Result from the console:

output from console

Any help really appreciated!

Thanks.

+4
source share

All Articles