Austin Ziegler wrote:
> On 10/22/07, venture Lee <liwenqiu / gmail.com> wrote:
>> i not a c/c++ programer :)
> 
> That may be. There's no inbuilt Ruby way to get what you want.

No, but there's windows-pr. :)

require 'windows/national'
include Windows::National

buf = 0.chr * 32

GetLocaleInfo(
    LOCALE_SYSTEM_DEFAULT,
    LOCALE_IDEFAULTCODEPAGE,
    buf,
    buf.length
)

cp = buf.strip.to_i

# Results on my system
p cp            # => 437, literal code page
p CODE_PAGE[cp] # => "OEM = United States"

Regards,

Dan

PS - Those curious about the "OEM" thing can read 
http://blogs.msdn.com/oldnewthing/archive/2005/08/29/457483.aspx