rails4 unknown encoding name – CP720

This command fixed it for me (without the second command);

chcp 1252

This changes the code page of the current terminal.

UPDATE; why this happens?

From some other resources, this is caused by your current terminal as it is using a codepage (encoding) that is not supported by Ruby. Codepage 720 is Arabic characters used by MS-DOS back in the day, and seems Ruby do not have a translation table for it.

I recommend you switch your terminal codepage to something Ruby understands, like the windows 1252 character encoding of the Latin alphabet..

That will change the codepage only for this terminal. If you want to make the change permanent, you have to edit the Regedit as explained in this article but be aware this can cause your machine not to boot up!

A safer way for permanently force the terminal to use the right code page is by using a batch as explained here.

If you are using nodejs and interested on the “nodevars.bat” I’m currently using, then check this post.

Leave a Comment