As per the Heroku support staff, this is the magic thing:

heroku config:add LANG=en_US.UTF-8

Although heroku console will keep reporting strings encoding as ASCII-8BIT, your actuall app will be running with the correct encoding, based on the LANG config var. You can double check that by doing this:

$ heroku run bash
Running bash attached to terminal... up, run.2
u20415@022e95bf-3ab6-4291-97b1-741f95e7fbda:/app$ irb
irb(main):001:0> "a".encoding
=> #<Encoding:UTF-8>

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-09-07
  • 2022-02-02
  • 2021-10-15
  • 2021-11-17
  • 2021-09-30
  • 2022-01-01
猜你喜欢
  • 2022-03-01
  • 2021-06-18
  • 2021-08-12
  • 2022-12-23
  • 2021-11-11
相关资源
相似解决方案