Bug #4854

Invalid locale_charmap (CP0) when running as Windows Service

Added by Rafal Bigaj over 4 years ago. Updated over 4 years ago.

ruby -v:ruby 1.9.2p136 Backport:


When ruby process is run as Windows Service the console codepage is not set, GetConsoleCP returns 0.
As a result function rb_locale_charmap refers to not existing codepage: CP0.
It has a dramatic performance drawback on the system when for ex. enumerating through ENV.
The attached patch simple checks if the GetConsoleCP() returns 0 and if so uses the actual system codepage.

encoding.codepage.patch Magnifier (531 Bytes) Rafal Bigaj, 06/08/2011 04:38 PM

Associated revisions

Revision 31985
Added by Yui NARUSE over 4 years ago

Revision 31985
Added by Yui NARUSE over 4 years ago


#1 Updated by Yui NARUSE over 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r31985.
Rafal, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

Also available in: Atom PDF