diff --git a/spec/integration/session_spec.rb b/spec/integration/session_spec.rb index eec0ab3..e8c4f75 100644 --- a/spec/integration/session_spec.rb +++ b/spec/integration/session_spec.rb @@ -53,6 +53,7 @@ describe Capybara::Session do Hello UTF8文字列 + HTML [200, @@ -69,11 +70,14 @@ describe Capybara::Session do subject.all(:xpath, "//strong").first.inspect.should include("strong") end - it "utf8 string" do + it "can read utf8 string" do utf8str = subject.all(:xpath, "//span").first.text - utf8str = utf8str.dup.force_encoding('UTF-8') if Kernel.const_defined?(:Encoding) # for Ruby 1.9 utf8str.should eq('UTF8文字列') end + + it "can click utf8 string" do + subject.click_button('ボタン') + end end end diff --git a/src/Connection.cpp b/src/Connection.cpp index 69753fe..66e0eac 100644 --- a/src/Connection.cpp +++ b/src/Connection.cpp @@ -69,7 +69,7 @@ void Connection::processArgument(const char *data) { } else if (m_expectingDataSize == -1) { m_expectingDataSize = QString(data).toInt(); } else { - m_arguments.append(data); + m_arguments.append(QString::fromUtf8(data)); } if (m_arguments.length() == m_argumentsExpected) {