Invalid locale_charmap (CP0) when running as Windows Service
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.
Updated by naruse (Yui NARUSE) over 9 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.
- encoding.c (rb_locale_charmap): When ruby process is run as Windows Service the console codepage is not set, GetConsoleCP returns 0. So on such environment, use GetACP(). http://blogs.msdn.com/b/michkap/archive/2005/02/08/369197.aspx patched by Rafal Bigaj [ruby-core:36832] [Bug #4854]