aboutsummaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/encoding.c b/encoding.c
index 4e3a02f173..46853964e1 100644
--- a/encoding.c
+++ b/encoding.c
@@ -943,7 +943,9 @@ rb_enc_set_default_external(VALUE encoding)
VALUE
rb_locale_charmap(VALUE klass)
{
-#ifdef HAVE_LANGINFO_H
+#if defined NO_LOCALE_CHARMAP
+ return Qnil;
+#elif defined HAVE_LANGINFO_H
char *codeset;
codeset = nl_langinfo(CODESET);
return rb_str_new2(codeset);