Issue #5637 has been updated by knu (Akinori MUSHA).


As I documented, it's all up to how you use the resulted string.

If you are going to pass it to a shell that lacks support for the encoding of the string, then you should probably encode the original string in ASCII-8BIT before shell-escaping with shellescape() to get a byte-by-byte escape to make sure the shell won't find a metacharacter inside a multibyte character.

UTF-8 multibyte characters do not contain any ASCII character by design anyway, so most people in the everything-is-UTF-8 world don't even have to care about this.

But, for example, when you have to run a program passing a Shift_JIS string via a shell under a non-Shift_JIS locale, you'd probably have to compose the command line in the ASCII-8BIT encoding so that all shell metacharacters that may appear in Shift_JIS multibyte characters are properly escaped.
----------------------------------------
Bug #5637: warnings of shellescape
https://bugs.ruby-lang.org/issues/5637#change-28727

Author: znz (Kazuhiro NISHIYAMA)
Status: Closed
Priority: Normal
Assignee: knu (Akinori MUSHA)
Category: lib
Target version: 2.0.0
ruby -v: -


\\???


-- 
http://bugs.ruby-lang.org/