mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-21 07:45:02 +02:00
ruby: converts encodings into UTF-8 on Ruby 1.9
This commit is contained in:
@@ -17,9 +17,17 @@
|
||||
*/
|
||||
#include "pack.h"
|
||||
#include "unpack.h"
|
||||
#include "encoding.h"
|
||||
|
||||
static VALUE mMessagePack;
|
||||
|
||||
#ifdef MSGPACK_RUBY_ENCODING
|
||||
int s_enc_utf8;
|
||||
int s_enc_ascii8bit;
|
||||
int s_enc_usascii;
|
||||
VALUE s_enc_utf8_value;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Document-module: MessagePack
|
||||
*
|
||||
@@ -46,6 +54,13 @@ void Init_msgpack(void)
|
||||
|
||||
rb_define_const(mMessagePack, "VERSION", rb_str_new2(MESSAGEPACK_VERSION));
|
||||
|
||||
#ifdef MSGPACK_RUBY_ENCODING
|
||||
s_enc_ascii8bit = rb_ascii8bit_encindex();
|
||||
s_enc_utf8 = rb_utf8_encindex();
|
||||
s_enc_usascii = rb_usascii_encindex();
|
||||
s_enc_utf8_value = rb_enc_from_encoding(rb_utf8_encoding());
|
||||
#endif
|
||||
|
||||
Init_msgpack_unpack(mMessagePack);
|
||||
Init_msgpack_pack(mMessagePack);
|
||||
}
|
||||
|
Reference in New Issue
Block a user