Ruby Iconv works with irb and ruby debugger but not in a unit test

佐手、 提交于 2019-12-04 11:16:28

This appears to be a problem with the locale - the same which is also observed in php, where (sometimes?) iconv functions don't work if there is no locale set (whatever the locale).

See a thread on this on ruby-forum.com where a low-level fix is suggested which allows you to set a locale using setlocale() in C.

Another suggestion is to install the locale gem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!