如何在Rails控制台中输入Unicode字符? [英] How to input Unicode character in Rails console?

查看:83
本文介绍了如何在Rails控制台中输入Unicode字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Rails控制台时,当我输入ä时,会出现 \U + FFC3\U + FFA4
当然我可以在rails之外输入Unicode字符。

While using Rails console, when I input ä, \U+FFC3\U+FFA4 appears. Of course I can input Unicode characters outside of rails.

我正在使用Ruby 2.0.0p247,在Max OS X 10.7.5中使用Rails 4.0.0。

I'm using Ruby 2.0.0p247, Rails 4.0.0 in Max OS X 10.7.5.

如何在Rails控制台中输入Unicode字符?

How can I input Unicode characters in Rails console?

推荐答案

您很可能遇到了readline问题,请尝试重新安装具有readline支持的Ruby。 https://github.com/wayneeseguin/rvm/issues/1016 http:// /blog.rlmflores.me/blog/2012/04/25/adding-utf-8-support-to-rubies-compiled-through-ruby-build/

Most likely you've got readline issue, try to re-install Ruby with readline support. https://github.com/wayneeseguin/rvm/issues/1016 or http://blog.rlmflores.me/blog/2012/04/25/adding-utf-8-support-to-rubies-compiled-through-ruby-build/

这篇关于如何在Rails控制台中输入Unicode字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆