简体   繁体   English

如何在RAILS CONSOLE中显示UTF-8字符?

[英]How to display UTF-8 characters in RAILS CONSOLE?

I am trying to display UTF-8 characters, in particular characters from the Tamil language, in the Rails Console. 我正在尝试在Rails控制台中显示UTF-8字符,尤其是泰米尔语的字符。

Currently, my entries in my MongoDB database are displayed in the Rails console as follows: "_____" . 当前,我在MongoDB数据库中的条目在Rails控制台中显示如下: “ _____”

On my Rails application, ie localhost, however, I see the actual Tamil characters: ie அம்மா . 但是,在我的Rails应用程序(即localhost)上,我看到了实际的泰米尔字符:即அம்மா

Now I wonder what I can do to display the UTF-8 characters in the Rails console using a Windows machine. 现在,我想知道如何使用Windows机器在Rails控制台中显示UTF-8字符。 I have tried installing the 'rb-readline' gem, however, it is not solving my problem. 我尝试安装“ rb-readline” gem,但是,它不能解决我的问题。 Any suggestions? 有什么建议么?

This isn't exactly a Rails issue. 这不完全是Rails的问题。 You might need to update the encoding of Windows command line. 您可能需要更新Windows命令行的编码。

Change the code page , 更改代码页

chcp 65001

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM