mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
* configure.in: check langinfo.h and locale.h.
* encoding.c: use langinfo.h only if available. * main.c: use locale.h only if available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a34e08d84
commit
f2515d9938
4 changed files with 19 additions and 1 deletions
|
@ -14,7 +14,9 @@
|
|||
#include "ruby/encoding.h"
|
||||
#include "regenc.h"
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
static ID id_encoding, id_based_encoding;
|
||||
static VALUE rb_cEncoding;
|
||||
|
@ -707,9 +709,13 @@ rb_enc_set_default_external(VALUE encoding)
|
|||
VALUE
|
||||
rb_locale_charmap(VALUE klass)
|
||||
{
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
char *codeset;
|
||||
codeset = nl_langinfo(CODESET);
|
||||
return rb_str_new2(codeset);
|
||||
#else
|
||||
return rb_str_new2("ASCII-8BIT");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue