diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-07-24 14:24:18 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2021-07-24 14:31:41 +0900 |
commit | eec45a93effe69a821960839760b9e39be1ebc63 (patch) | |
tree | 0f3ab0bab09728300ecd9ffcef6179d9ce6f9661 /string.c | |
parent | 8cc18703cfa7ff88b6ca51267e557fa2658a78fb (diff) |
Escape unprintable chars only, without surrounding quotes
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4676
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -11050,7 +11050,7 @@ rb_str_quote_unprintable(VALUE str) len = RSTRING_LEN(str); if ((resenc != enc && !rb_str_is_ascii_only_p(str)) || !sym_printable(ptr, ptr + len, enc)) { - return rb_str_inspect(str); + return rb_str_escape(str); } return str; } @@ -11060,7 +11060,7 @@ rb_id_quote_unprintable(ID id) { VALUE str = rb_id2str(id); if (!rb_str_symname_p(str)) { - return rb_str_inspect(str); + return rb_str_escape(str); } return str; } |