< :前の番号
^ :番号順リスト
> :次の番号
P :前の記事(スレッド移動)
N :次の記事(スレッド移動)
|<:前のスレッド
>|:次のスレッド
^ :返事先
_:自分への返事
>:同じ返事先を持つ記事(前)
<:同じ返事先を持つ記事(後)
---:分割してスレッド表示、再表示
| :分割して(縦)スレッド表示、再表示
~ :スレッドのフレーム消去
.:インデックス
..:インデックスのインデックス
Issue #14863 has been updated by cremno (cremno phobia).
I also believe the current behavior makes sense. It won't cause the `invalid byte sequence in UTF-8` issue. The US-ASCII character set is THE subset (see BINARY which is actually called ASCII-8BIT). Sure the characters are sometimes encoded differently (e.g. UTF-32BE uses 4 bytes) but US-ASCII is fully compatible to UTF-8. Especially in this case as an empty string doesn't contain any characters/byte sequences.
Meanwhile your proposal isn't radical enough to make sense to me: what about `nil.to_s`? Or the non-empty `65.chr`?
----------------------------------------
Bug #14863: Array#join with empty array returns empty string always in US-ASCII encoding
https://bugs.ruby-lang.org/issues/14863#change-72719
* Author: xsimov (Xavier Sim)
* Status: Feedback
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: 2.4.2
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Calling
~~~
irb(main):001:0> [].join.encoding
=> #<Encoding:US-ASCII>
~~~
returns an empty string and that empty string is always in US-ASCII encoding.
The expected result is that the returned empty string would be in UTF-8 since it seems to be the default for Ruby strings since 2.0.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>