summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-08 12:05:18 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-10-08 12:05:18 +0000
commitb7212ba643b8db2a580c457f6189385f00db5d99 (patch)
tree18a2a3106c44caa5251391dff4bb965861d4c507 /ext/win32ole
parentd245085630c24e7af6c47e1879b90767040110ed (diff)
* ext/win32ole/win32ole.c (ole_init_cp): initialize WIN32OLE.codepage
according to Encoding.default_internal and Encoding.default_external. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 0f07844..915ffb3 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -118,7 +118,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.3.3"
+#define WIN32OLE_VERSION "1.3.4"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -961,7 +961,10 @@ ole_init_cp()
{
UINT cp;
rb_encoding *encdef;
- encdef = rb_default_external_encoding();
+ encdef = rb_default_internal_encoding();
+ if (!encdef) {
+ encdef = rb_default_external_encoding();
+ }
cp = ole_encoding2cp(encdef);
if (code_page_installed(cp)) {
cWIN32OLE_cp = cp;
@@ -2908,9 +2911,14 @@ code_page_installed(UINT cp)
* call-seq:
* WIN32OLE.codepage = CP
*
- * Sets current codepage.
+ * Sets current codepage.
+ * The WIN32OLE.codepage is initialized according to
+ * Encoding.default_internal.
+ * If Encoding.default_internal is nil then WIN32OLE.codepage
+ * is initialized according to Encoding.default_external.
+ *
* WIN32OLE.codepage = WIN32OLE::CP_UTF8
- * WIN32OLE.codepage = 20932
+ * WIN32OLE.codepage = 65001
*/
static VALUE
fole_s_set_code_page(VALUE self, VALUE vcp)