From: "drbrain (Eric Hodel)" Date: 2013-01-30T05:11:39+09:00 Subject: [ruby-core:51743] [ruby-trunk - Bug #7752] Rational/Float/Fixnum/Bignum `.to_s.encoding` is US-ASCII Issue #7752 has been updated by drbrain (Eric Hodel). Category set to core This behavior matches Time#to_s, see #5226 Since there are no non-US-ASCII characters in the result of to_s on Rational, Float, Fixnum or Bignum there should be no problem with the US-ASCII encoding. Can you demonstrate one? ---------------------------------------- Bug #7752: Rational/Float/Fixnum/Bignum `.to_s.encoding` is US-ASCII https://bugs.ruby-lang.org/issues/7752#change-35705 Author: coffeejunk (Maximilian Haack) Status: Open Priority: Normal Assignee: Category: core Target version: 2.0.0 ruby -v: 2.0.0dev =begin When converting an instance of Rational/Float/Fixnum/Bignum to a string with the (({.to_s})) method, the resulting string has the encoding US-ASCII. This happens for 1.9.3 as well as 2.0.0rc1. (({> __ENCODING__})) (({ => #})) (({> Encoding.default_internal})) (({ => #})) (({> Encoding.default_external})) (({ => #})) (({> 1.to_s.encoding})) (({#=> #})) (({> (2/1).to_r.to_s.encoding})) (({ => #})) (({> "abc".encoding})) (({ => #})) =end -- http://bugs.ruby-lang.org/