mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 11:03:58 +02:00
* 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:
parent
52b3e3b97f
commit
6259c87d02
6 changed files with 117 additions and 77 deletions
|
@ -92,7 +92,8 @@ char* rb_enc_nth(const char*, const char*, int, rb_encoding*);
|
|||
VALUE rb_obj_encoding(VALUE);
|
||||
VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
|
||||
|
||||
VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *enc);
|
||||
VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
|
||||
VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
|
||||
|
||||
/* index -> rb_encoding */
|
||||
rb_encoding* rb_enc_from_index(int idx);
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue