summaryrefslogtreecommitdiff
path: root/encoding.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-19 10:55:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-19 10:55:39 +0000
commiteeb3156ecaef7d5b6ad6be1e57e18d1944f0ef8f (patch)
tree0438d889ce0550308d38b9ab7da9217c2605e20d /encoding.c
parent6bf78ee633038d8de428996f133cd54f73cfd602 (diff)
downloadbundler-eeb3156ecaef7d5b6ad6be1e57e18d1944f0ef8f.tar.gz
encoding.c: defer code page table
* encoding.c (rb_locale_encindex): defer initialization of win32 code page table until encoding db loaded. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c
index 4b5b446b6c..4793e67375 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1272,7 +1272,13 @@ rb_locale_encindex(void)
else if ((idx = rb_enc_find_index(StringValueCStr(charmap))) < 0)
idx = ENCINDEX_ASCII;
- if (rb_enc_registered("locale") < 0) enc_alias_internal("locale", idx);
+ if (rb_enc_registered("locale") < 0) {
+# if defined _WIN32
+ void Init_w32_codepage(void);
+ Init_w32_codepage();
+# endif
+ enc_alias_internal("locale", idx);
+ }
return idx;
}