How to find the cause of encoding mismatch error(CompatibilityError)?

Viewed 20

I am facing the error on rails console in a specific host(Ubuntu+rbenv).

irb(main):001:0> "あ".encoding
=> #<Encoding:UTF-8>
irb(main):002:0> "あ".titleize
Traceback (most recent call last):
        2: from (irb):10
        1: from (irb):11:in `rescue in irb_binding'
Encoding::CompatibilityError (incompatible encoding regexp match (ISO-8859-1 regexp with UTF-8 string))
  • Ruby 2.7.5
  • Rails(activesupport) 5.2.6

My question is "which settings can affect such error?" rather than "how to solve the error".

0 Answers
Related