1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00

support utf8 command ( ruby to webkit_server )

This commit is contained in:
Yuichi Tateno 2011-04-19 20:51:38 +09:00
parent 246597c36b
commit 9db603cbea
2 changed files with 7 additions and 3 deletions

View file

@ -53,6 +53,7 @@ describe Capybara::Session do
<html><body>
<strong>Hello</strong>
<span>UTF8文字列</span>
<input type="button" value="ボタン" />
</body></html>
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

View file

@ -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) {