How to input Unicode character in Rails console?

前端 未结 2 1602
悲&欢浪女
悲&欢浪女 2021-01-04 10:42

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

I\'m using

2条回答
  •  猫巷女王i
    2021-01-04 11:19

    I did have the same problem. After done a lot of things, including the complete reinstall of RVM, I'd realized I just need to define the LC variables. To do the same, run these commands on terminal:

    LANG="en_US.UTF-8"
    LC_COLLATE="en_US.UTF-8"
    LC_CTYPE="en_US.UTF-8"
    LC_MESSAGES="en_US.UTF-8"
    LC_MONETARY="en_US.UTF-8"
    LC_NUMERIC="en_US.UTF-8"
    LC_TIME="en_US.UTF-8"
    LC_ALL="en_US.UTF-8"
    export LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LC_ALL
    

    One good idea is save this code in .bash_profile or .bashrc files in the App folder.

提交回复
热议问题