From c0398f3fd7e28095ff35532826f8555475f349d2 Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 28 Jan 2011 20:02:54 +0900 Subject: [PATCH 1/2] use setUseSystemConfiguration(true). --- src/phantomjs.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/phantomjs.cpp b/src/phantomjs.cpp index 9152c56d9..b6e9116cb 100644 --- a/src/phantomjs.cpp +++ b/src/phantomjs.cpp @@ -203,7 +203,7 @@ void Phantom::execute(const QString &fileName) exit(1); return; } - m_script = file.readAll(); + m_script = file.readAll(); file.close(); m_page.mainFrame()->evaluateJavaScript(m_script); @@ -341,6 +341,8 @@ int main(int argc, char** argv) return 1; } + QNetworkProxyFactory::setUseSystemConfiguration(true); + QApplication app(argc, argv); app.setWindowIcon(QIcon(":/phantomjs-icon.png")); From ee54806abcc1173eb56e21f78978be3d3afffe5f Mon Sep 17 00:00:00 2001 From: mattn Date: Fri, 28 Jan 2011 20:04:00 +0900 Subject: [PATCH 2/2] load script as utf-8 encoding. --- src/phantomjs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phantomjs.cpp b/src/phantomjs.cpp index b6e9116cb..3ad2f5f84 100644 --- a/src/phantomjs.cpp +++ b/src/phantomjs.cpp @@ -203,7 +203,7 @@ void Phantom::execute(const QString &fileName) exit(1); return; } - m_script = file.readAll(); + m_script = QString::fromUtf8(file.readAll()); file.close(); m_page.mainFrame()->evaluateJavaScript(m_script);