The page opened using save_and_open_page in capybara will be garbled only in Japanese as shown below.
Please let me know if there is any way to fix it.
ruby ruby-on-rails rspec capybara
In the head of layouts/application.html.erb
<metahttp-equiv="Content-Type" content="text/html;charset=utf-8"/>
The garbled characters have been corrected by adding .
If you want to use meta http-equiv to specify charset in the HTML header, write it at the beginning of the head tag.
If Japanese strings are used in title tags before charset specification, the browser implementation may cause garbled characters.
© 2024 OneMinuteCode. All rights reserved.