Skip to content

Instantly share code, notes, and snippets.

@yannvery
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save yannvery/fdb1bf8a3b8feee9811f to your computer and use it in GitHub Desktop.

Select an option

Save yannvery/fdb1bf8a3b8feee9811f to your computer and use it in GitHub Desktop.
Capybara encountered some issues cause utf8

On a specific project I encountered some issues with encoding.

Capybara Launchy and html meta

When I used save_and_open_page the html page opens with bad encoding chars ( accent chars ).

To fix this I just add on my layout header this forgotten meta : <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

warning: regexp match /.../n against to UTF-8 string

During some tests I encountered this warning randomly due to faker data.

This is due to regexp apply on utf8 string with /n modifier. Modifier is used to overridden with encoding source, and generate this warn.

To fix this I remove the /nmodifier.

Source : http://ruby-doc.org/core-2.2.2/Regexp.html#class-Regexp-label-Encoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment