71a74ad035
String.new with no arguments returns the empty string with ASCII-8BIT encoding. Then, depending on each grapheme cluster of the string and on the omission string, the resulting string might keep the ASCII-8BIT encoding. With this change, we preserve the encoding of the original string instead. Note that String.new accepts an `encoding` keyword argument, like ``` String.new(encoding: Encoding::UTF_8) ``` However, instead of using that, we rely on `force_encoding` to set the original encoding. This is so that String subclasses don't need to preserve this keyword argument. For example, SafeBuffer doesn't. Thanks to @jeremy for catching this! |
||
---|---|---|
.. | ||
active_support | ||
active_support.rb |