Ruby 1.9 - invalid multibyte char (US-ASCII)

后端 未结 3 1285
慢半拍i
慢半拍i 2020-12-12 14:53

Im trying to make my rails application (2.3.5) to run on Ruby 1.9, I\'ve this function that make some transformations on a string:

def replace_special_chars(         


        
3条回答
  •  感动是毒
    2020-12-12 15:48

    Write # encoding: utf-8 on top of that file. That changes the default encoding of all string/regexp literals in that file utf-8. The default encoding for all literals is US-ASCII, which cannot represent á.

提交回复
热议问题