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.
while executing gem ... (ArgumentError) unknown encoding name - CP720
When did you do
chcp 1252
did you get
Active code page: 1252
as a confirmation?
If not then maybe you are not using one of the windows command prompts like the default one or the node.js command prompt.. Because this won't work on the Git command prompt (MINGW32).
After you get the confirmation of changing the code page, you can execute gem commands without the annoying unknown encoding name error.
SASS installation issue with ruby
This is caused by your current terminal as it is using a codepage (encoding) that is not supported by Ruby, as Codepage 720
is related with Arabic characters as given here
so there are two possible solutions
- change the default system language and restart.
- run command
chcp 1252
if you don't want to change default language
also check that solution as well.
Gem install error (sass compass)
Open up a command prompt and type:
chcp 1252
Then run the installer again:
gem install sass
Unfortunately there's a known issue in some versions of Ruby regarding this. See here
Obtain the name of a unknown process, by the window handle?
I don't know Ruby, but since you are invoking the WinAPI directly anyway, I can give you an example in C. Assuming you already have a HWND
called hWnd
scoped (error handling omitted for brevity):
HANDLE hProcess;
DWORD dwPID;
WCHAR lpFilename[MAX_PATH];
GetWindowThreadProcessId(hWnd, &dwPID)
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, dwPID);
GetModuleFileNameEx(hProcess, NULL, lpFilename, _countof(lpFilename));
CloseHandle(hProcess);
Related Topics
How to Use Global Variables or Constant Values in Ruby
Set Global Default Encoding For Ruby 1.9
Converting String from Snake_Case to Camelcase in Ruby
How to Calculate the Day of the Week of a Date in Ruby
How to Format a Date in Ruby to Include "Rd" as in "3Rd"
Ruby: What Does the Comment "Frozen_String_Literal: True" Do
Confirmation About Pgrep Returning Itself
How to Split a String to Get All the Substrings by Ruby
Extending Devise Sessionscontroller to Authenticate Using JSON
Cron Job Not Working in Whenever Gem
Getting Fields_For and Accepts_Nested_Attributes_For to Work With a Belongs_To Relationship
How to Hide Password Input from Terminal in Ruby Script
Running a Command from Ruby Displaying and Capturing the Output
Getting "Warning! Path Is Not Properly Set Up" When Doing Rvm Use 2.0.0 --Default