[#64703] Add `Hash#fetch_at` (issue #10017) — Wojtek Mach <wojtek@...>
Hey guys
1 message
2014/09/01
[#64711] [ruby-trunk - Bug #10193] [Closed] TestIO#test_readpartial_locktmp fails randomly — nobu@...
Issue #10193 has been updated by Nobuyoshi Nakada.
3 messages
2014/09/02
[#64744] [ruby-trunk - Bug #10202] [Open] TestBenchmark#test_realtime_output breaks on ARM — v.ondruch@...
Issue #10202 has been reported by Vit Ondruch.
3 messages
2014/09/03
[#64823] documenting constants — Xavier Noria <fxn@...>
I am writing a Rails guide about constant autoloading in Ruby on
5 messages
2014/09/07
[#64838] [ruby-trunk - Bug #10212] [Open] MRI is not for lambda calculus — ko1@...
Issue #10212 has been reported by Koichi Sasada.
6 messages
2014/09/08
[#64858] Re: [ruby-trunk - Bug #10212] [Open] MRI is not for lambda calculus
— Eric Wong <normalperson@...>
2014/09/08
rb_env_t may use a flexible array, helps a little even on my busy system:
[#64871] Re: [ruby-trunk - Bug #10212] [Open] MRI is not for lambda calculus
— SASADA Koichi <ko1@...>
2014/09/08
(2014/09/08 19:48), Eric Wong wrote:
[#64972] [ruby-trunk - Bug #10231] [Open] Process.detach(pid) defines new singleton classes every call — headius@...
Issue #10231 has been reported by Charles Nutter.
3 messages
2014/09/11
[#64980] [ruby-trunk - Bug #10212] MRI is not for lambda calculus — ko1@...
Issue #10212 has been updated by Koichi Sasada.
4 messages
2014/09/12
[#65142] [ruby-trunk - Feature #10267] [Open] Number of processors — akr@...
Issue #10267 has been reported by Akira Tanaka.
4 messages
2014/09/20
[#65144] Re: [ruby-trunk - Feature #10267] [Open] Number of processors
— Eric Wong <normalperson@...>
2014/09/20
akr@fsij.org wrote:
[#65210] [ruby-trunk - misc #10278] [Assigned] [RFC] st.c: use ccan linked list — nobu@...
Issue #10278 has been updated by Nobuyoshi Nakada.
3 messages
2014/09/22
[ruby-core:65036] [ruby-trunk - Bug #9766] Add force_encoding option to csv
From:
nagachika00@...
Date:
2014-09-14 15:26:14 UTC
List:
ruby-core #65036
Issue #9766 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE
r46391 and r46395 were backported into `ruby_2_1` branch at r47586.
----------------------------------------
Bug #9766: Add force_encoding option to csv
https://bugs.ruby-lang.org/issues/9766#change-48902
* Author: DAISUKE TANIWAKI
* Status: Closed
* Priority: Normal
* Assignee: James Gray
* Category: lib
* Target version: current: 2.2.0
* ruby -v: all
* Backport: 2.0.0: REQUIRED, 2.1: DONE
----------------------------------------
Hi there,
I have a trouble when I use csv#generate with encoding 'Shift-JIS' option. I investigated it for a long time and found it is caused by compatibility within "UTF-8" and "Shift-JIS". Since "Shift-JIS" can be converted to UTF-8, a row with UTF-8 strings added to the csv instance makes the encoding of whole rows UTF-8.
Take a look at the code below.
https://github.com/dtaniwaki/ruby/blob/trunk/lib/csv.rb#L1658
Here's the code example.
```ruby
irb(main):002:0> s = generate(encoding: 'SJIS') do |csv|
csv << ['あ']
end
=> ["あ"]
irb(main):003:0> s
=> "あ\n"
irb(main):004:0> s.encoding
=> #<Encoding:UTF-8>
```
I was intended to make SJIS encoded csv, but the result was UTF-8 csv. I think everyone think it should generate Shift-JIS encoded csv string, so could you consider to merge the change attached to this issue?
The expected result is here.
```ruby
irb(main):002:0> s = generate(encoding: 'SJIS', force_encoding: true) do |csv|
csv << ['あ']
end
=> ["あ"]
irb(main):003:0> s
=> "\x{E381}\x82\n"
irb(main):004:0> s.encoding
=> #<Encoding:Windows-31J>
```
---Files--------------------------------
csv.rb.diff (1.41 KB)
0001-csv.rb-honor-encoding-option.patch (2.64 KB)
--
https://bugs.ruby-lang.org/