Search code examples
windowsutf-8console.readline

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.

Currently, my entries in my MongoDB database are displayed in the Rails console as follows: "_____".

On my Rails application, i.e. localhost, however, I see the actual Tamil characters: i.e. அம்மா.

Now I wonder what I can do to display the UTF-8 characters in the Rails console using a Windows machine. I have tried installing the 'rb-readline' gem, however, it is not solving my problem. Any suggestions?


Solution

  • This isn't exactly a Rails issue. You might need to update the encoding of Windows command line.

    Change the code page,

    chcp 65001