Issue #15876 has been updated by duerst (Martin D=FCrst).


@mame:

What @grosser is saying is that
```
p s1.encoding =3D=3D s2.encoding #=3D> false
```
but he expects the result to be true. But you are right that what counts is=
 the equality of the strings, not the encodings.

----------------------------------------
Bug #15876: 1.to_s.encoding !=3D Encoding.default_internal
https://bugs.ruby-lang.org/issues/15876#change-78227

* Author: grosser (Michael Grosser)
* Status: Open
* Priority: Normal
* Assignee: =

* Target version: =

* ruby -v: 2.6.3
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
I ran into strange looking test output when I compared .to_s with an expect=
ed text, saying that the encoding was different, which is confusing/annoyin=
g especially to users that don't know how encodings work in ruby.
1.to_s.encoding should be the same as "".encoding



-- =

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

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>