diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-08-06 16:14:03 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-08-06 16:14:03 +0200 |
commit | 7047b953adab26c7098cbfaea2b69f9d36231cd3 (patch) | |
tree | 8668c830838184ebc465554b85c085da42fb6f6a /rb/src/IceRuby/Util.cpp | |
parent | Missing files (diff) | |
parent | Removed Stream::format method, replace with startWriteEncaps parameter (diff) | |
download | ice-7047b953adab26c7098cbfaea2b69f9d36231cd3.tar.bz2 ice-7047b953adab26c7098cbfaea2b69f9d36231cd3.tar.xz ice-7047b953adab26c7098cbfaea2b69f9d36231cd3.zip |
Merge remote-tracking branch 'origin/encoding11' into mx
Conflicts:
cpp/src/Ice/.depend
cpp/src/Ice/.depend.mak
cpp/src/slice2cpp/Gen.cpp
Diffstat (limited to 'rb/src/IceRuby/Util.cpp')
-rw-r--r-- | rb/src/IceRuby/Util.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/rb/src/IceRuby/Util.cpp b/rb/src/IceRuby/Util.cpp index 6e62ee391d5..d786d10715e 100644 --- a/rb/src/IceRuby/Util.cpp +++ b/rb/src/IceRuby/Util.cpp @@ -11,6 +11,10 @@ #include <Ice/LocalException.h> #include <stdarg.h> +#ifdef HAVE_RUBY_ENCODING_H +# include <ruby/encoding.h> +#endif + using namespace std; using namespace IceRuby; @@ -294,7 +298,11 @@ IceRuby::getString(VALUE val) VALUE IceRuby::createString(const string& str) { +#ifdef HAVE_RUBY_ENCODING_H + return callRuby(rb_enc_str_new, str.c_str(), static_cast<long>(str.size()), rb_utf8_encoding()); +#else return callRuby(rb_str_new, str.c_str(), static_cast<long>(str.size())); +#endif } long |