Windowsでコードページを取得する方法

Cの場合

static char buf[2 + 10 + 1];
sprintf (buf, "CP%u", GetACP ());
codeset = buf;

Rubyの場合

require 'win32api'
GetACP = Win32API.new('kernel32.dll', 'GetACP', '', 'l')
codeset = 'CP' + GetACP.call.to_s
Last modified:2006/10/28 23:03:27
Keyword(s):
References: