* include/ruby/ruby.h (ExportStringValue): new macro to convert

string in internal encoding to external to export.

* string.c (rb_str_export): new function to do conversion to
  external encoding.

* ext/sdbm/init.c: encoding conversion support.

* ext/dbm/dbm.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-10-20 08:05:44 +00:00
parent 52b3e3b97f
commit 6259c87d02
6 changed files with 117 additions and 77 deletions

View file

@ -373,6 +373,12 @@ void rb_check_safe_str(VALUE);
/* obsolete macro - use SafeStringValue(v) */
#define Check_SafeStr(v) rb_check_safe_str((VALUE)(v))
VALUE rb_str_export(VALUE);
#define ExportStringValue(v) do {\
SafeStringValue(v);\
(v) = rb_str_export(v);\
} while (0)
VALUE rb_get_path(VALUE);
#define FilePathValue(v) ((v) = rb_get_path(v))