String#encode not fixing “invalid byte sequence in UTF-8” error

后端 未结 2 1560
暗喜
暗喜 2020-12-05 16:08

I know there are multiple similar questions about this error, and I\'ve tried many of them without luck. The problem I\'m having involves the byte \\xA1 and is

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-05 16:37

    Maybe you are running this code in IRB. I have had a lot of encoding issues with IRB. In this case, try saving this code as a .rb file and run the code from the command line.

提交回复
热议问题