From: "jballanc (Joshua Ballanco)" Date: 2013-01-31T22:08:52+09:00 Subject: [ruby-core:51776] [ruby-trunk - Bug #7752] Rational/Float/Fixnum/Bignum `.to_s.encoding` is US-ASCII Issue #7752 has been updated by jballanc (Joshua Ballanco). US-ASCII is a strict subset of UTF-8, so I don't think there's necessarily any lying involved. ---------------------------------------- Bug #7752: Rational/Float/Fixnum/Bignum `.to_s.encoding` is US-ASCII https://bugs.ruby-lang.org/issues/7752#change-35744 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/