https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112012-11-03T12:20:07ZRuby Issue Tracking SystemRuby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=322772012-11-03T12:20:07Zmame (Yusuke Endoh)mame@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Assigned</i></li><li><strong>Assignee</strong> set to <i>tenderlovemaking (Aaron Patterson)</i></li><li><strong>Target version</strong> set to <i>2.0.0</i></li></ul><p>Aaron, what do you think?</p>
<p>--<br>
Yusuke Endoh <a href="mailto:mame@tsg.ne.jp" class="email">mame@tsg.ne.jp</a></p> Ruby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=352262013-01-06T11:20:51Zno6v (Nobuhiro IMAI)nov@yo.rim.or.jp
<ul><li><strong>File</strong> <a href="/attachments/3398">Time-on-NEWS.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/3398/Time-on-NEWS.patch">Time-on-NEWS.patch</a> added</li></ul><p>=begin<br>
This is still leaving...</p>
<p>$ ruby -E:utf-8 -ve 'p Encoding.default_internal, Time.now.to_s.encoding'<br>
ruby 2.0.0dev (2013-01-06 trunk 38711) [x86_64-linux]<br>
#<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a><br>
#<a href="Encoding:US-ASCII" class="external">Encoding:US-ASCII</a></p>
<p>I attached a patch to drop whole section of Time. Would you confirm that?<br>
=end</p> Ruby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=354902013-01-20T13:37:15Zzzak (zzak _)
<ul></ul><p>I think this is a bug on Time#to_s, not NEWS.</p>
<p>From <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Encoding of Time#to_s (Closed)" href="https://redmine.ruby-lang.org/issues/5226">#5226</a>:<br>
tenderlovemaking (Aaron Patterson) wrote:</p>
<blockquote>
<p>I think the encoding of Time#to_s should default to US-ASCII, but respect Encoding.default_internal.</p>
<p>I've attached a patch to make Time#to_s respect Encoding.default_internal. The result is:</p>
<p>irb(main):001:0> Encoding.default_internal<br>
=> nil<br>
irb(main):002:0> Time.now.to_s.encoding<br>
=> #<a href="Encoding:US-ASCII" class="external">Encoding:US-ASCII</a><br>
irb(main):003:0> Encoding.default_internal = Encoding::UTF_8<br>
=> #<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a><br>
irb(main):004:0> Time.now.to_s.encoding<br>
=> #<a href="Encoding:UTF-8" class="external">Encoding:UTF-8</a><br>
irb(main):005:0></p>
</blockquote>
<p>Can we change description?</p> Ruby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=354952013-01-20T17:01:04Zno6v (Nobuhiro IMAI)nov@yo.rim.or.jp
<ul></ul><blockquote>
<p>I think this is a bug on Time#to_s, not NEWS.</p>
<p>From <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Encoding of Time#to_s (Closed)" href="https://redmine.ruby-lang.org/issues/5226">#5226</a>:<br>
tenderlovemaking (Aaron Patterson) wrote:</p>
<blockquote>
<p>I think the encoding of Time#to_s should default to US-ASCII, but respect Encoding.default_internal.</p>
</blockquote>
</blockquote>
<p>It seems that Naruse-san didn't implement so on this point at r33094 explicitly.</p>
<pre><code>* time.c (time_to_s): the resulted string of Time#to_s is always
ascii only, so this should be US-ASCII.
</code></pre> Ruby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=355072013-01-21T03:50:02Zzzak (zzak _)
<ul></ul><p>=begin<br>
Thank you for finding that revision Nobuhiro-san, I must have missed it.</p>
<p>I think NEWS should say simply:<br>
(({Time#to_s now returns US-ASCII encoding instead of BINARY}))<br>
=end</p> Ruby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=355122013-01-21T18:24:11Zno6v (Nobuhiro IMAI)nov@yo.rim.or.jp
<ul></ul><blockquote>
<p>I think NEWS should say simply:<br>
(({Time#to_s now returns US-ASCII encoding instead of BINARY}))</p>
</blockquote>
<p><a class="user active user-mention" href="https://redmine.ruby-lang.org/users/1677">@zzak (zzak _)</a> Sounds good. I've been misunderstood as nothing has changed, thanks :).</p> Ruby master - Bug #6820: Time#to_s on NEWShttps://redmine.ruby-lang.org/issues/6820?journal_id=356662013-01-26T08:36:43Ztenderlovemaking (Aaron Patterson)tenderlove@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>This issue was solved with changeset r38944.<br>
Nobuhiro, thank you for reporting this issue.<br>
Your contribution to Ruby is greatly appreciated.<br>
May Ruby be with you.</p>
<hr>
<p>updating news [Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: Time#to_s on NEWS (Closed)" href="https://redmine.ruby-lang.org/issues/6820">#6820</a>]</p>