* [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
@ 2020-07-05 3:53 dr.drax
2020-07-05 10:16 ` [ruby-core:99063] " jean.boussier
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: dr.drax @ 2020-07-05 3:53 UTC (permalink / raw
To: ruby-core
Issue #17011 has been reported by david.drakard (David Drakard).
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011
* Author: david.drakard (David Drakard)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal` `.to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, because it requires an explicit cast, particularly because ASCII-8BIT is a special encoding that implies binary (non-textual) data.
`BigDecimal` `.to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer` `.to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:99063] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
@ 2020-07-05 10:16 ` jean.boussier
2020-07-05 10:41 ` [ruby-core:99064] " nobu
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jean.boussier @ 2020-07-05 10:16 UTC (permalink / raw
To: ruby-core
Issue #17011 has been updated by byroot (Jean Boussier).
I submitted a PR for it: https://github.com/ruby/ruby/pull/3291
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011#change-86436
* Author: david.drakard (David Drakard)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal` `.to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, since ASCII-8BIT is a special encoding that implies binary (non-textual) data, it can require an explicit conversion.
`BigDecimal` `.to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer` `.to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:99064] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
2020-07-05 10:16 ` [ruby-core:99063] " jean.boussier
@ 2020-07-05 10:41 ` nobu
2020-07-05 10:44 ` [ruby-core:99065] " jean.boussier
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: nobu @ 2020-07-05 10:41 UTC (permalink / raw
To: ruby-core
Issue #17011 has been updated by nobu (Nobuyoshi Nakada).
Description updated
Could you submit this to https://github.com/ruby/bigdecimal?
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011#change-86437
* Author: david.drakard (David Drakard)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal#to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, since ASCII-8BIT is a special encoding that implies binary (non-textual) data, it can require an explicit conversion.
`BigDecimal#to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer#to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:99065] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
2020-07-05 10:16 ` [ruby-core:99063] " jean.boussier
2020-07-05 10:41 ` [ruby-core:99064] " nobu
@ 2020-07-05 10:44 ` jean.boussier
2020-07-05 10:47 ` [ruby-core:99066] " jean.boussier
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: jean.boussier @ 2020-07-05 10:44 UTC (permalink / raw
To: ruby-core
Issue #17011 has been updated by byroot (Jean Boussier).
Sure.
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011#change-86438
* Author: david.drakard (David Drakard)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal#to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, since ASCII-8BIT is a special encoding that implies binary (non-textual) data, it can require an explicit conversion.
`BigDecimal#to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer#to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:99066] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
` (2 preceding siblings ...)
2020-07-05 10:44 ` [ruby-core:99065] " jean.boussier
@ 2020-07-05 10:47 ` jean.boussier
2020-07-05 12:14 ` [ruby-core:99068] " eregontp
2020-07-08 10:01 ` [ruby-core:99087] " eregontp
5 siblings, 0 replies; 7+ messages in thread
From: jean.boussier @ 2020-07-05 10:47 UTC (permalink / raw
To: ruby-core
Issue #17011 has been updated by byroot (Jean Boussier).
Actually, it's already been fixed upstream: https://github.com/ruby/bigdecimal/pull/160
Maybe the Ruby spec part of my PR is still useful. I'll submit it to https://github.com/ruby/spec
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011#change-86439
* Author: david.drakard (David Drakard)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal#to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, since ASCII-8BIT is a special encoding that implies binary (non-textual) data, it can require an explicit conversion.
`BigDecimal#to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer#to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:99068] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
` (3 preceding siblings ...)
2020-07-05 10:47 ` [ruby-core:99066] " jean.boussier
@ 2020-07-05 12:14 ` eregontp
2020-07-08 10:01 ` [ruby-core:99087] " eregontp
5 siblings, 0 replies; 7+ messages in thread
From: eregontp @ 2020-07-05 12:14 UTC (permalink / raw
To: ruby-core
Issue #17011 has been updated by Eregon (Benoit Daloze).
How should we proceed to include that fix in CRuby master?
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011#change-86441
* Author: david.drakard (David Drakard)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal#to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, since ASCII-8BIT is a special encoding that implies binary (non-textual) data, it can require an explicit conversion.
`BigDecimal#to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer#to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
* [ruby-core:99087] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
` (4 preceding siblings ...)
2020-07-05 12:14 ` [ruby-core:99068] " eregontp
@ 2020-07-08 10:01 ` eregontp
5 siblings, 0 replies; 7+ messages in thread
From: eregontp @ 2020-07-08 10:01 UTC (permalink / raw
To: ruby-core
Issue #17011 has been updated by Eregon (Benoit Daloze).
Assignee set to nobu (Nobuyoshi Nakada)
Status changed from Open to Closed
@nobu picked that fix in https://github.com/ruby/ruby/commit/6a826eb4b08484cb3b6279da905f5b9e03e0df5f
(details at https://github.com/ruby/spec/pull/778#issuecomment-655420419)
Thanks!
----------------------------------------
Bug #17011: BigDecimal .to_s should not use ASCII-8BIT
https://bugs.ruby-lang.org/issues/17011#change-86459
* Author: david.drakard (David Drakard)
* Status: Closed
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
`BigDecimal#to_s` returns a `String` in ASCII-8BIT encoding. This is inconvenient in situations where the encoding determines program behaviour, since ASCII-8BIT is a special encoding that implies binary (non-textual) data, it can require an explicit conversion.
`BigDecimal#to_s` should either use the currently active encoding, or it should use US-ASCII like `Integer#to_s`.
Recreation script:
``` ruby
# encoding: utf-8
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8
require 'bigdecimal'
puts BigDecimal('2').to_s.encoding
```
Desired output: `US-ASCII` or `UTF-8`
Actual output: `ASCII-8BIT`
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-07-08 10:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-05 3:53 [ruby-core:99060] [Ruby master Bug#17011] BigDecimal .to_s should not use ASCII-8BIT dr.drax
2020-07-05 10:16 ` [ruby-core:99063] " jean.boussier
2020-07-05 10:41 ` [ruby-core:99064] " nobu
2020-07-05 10:44 ` [ruby-core:99065] " jean.boussier
2020-07-05 10:47 ` [ruby-core:99066] " jean.boussier
2020-07-05 12:14 ` [ruby-core:99068] " eregontp
2020-07-08 10:01 ` [ruby-core:99087] " eregontp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).