[#85349] [Ruby trunk Bug#14334] Segmentation fault after running rspec (ruby/2.5.0/erb.rb:885 / simplecov/source_file.rb:85) — pragtob@...
Issue #14334 has been updated by PragTob (Tobias Pfeiffer).
3 messages
2018/02/02
[#85358] Re: [ruby-cvs:69220] nobu:r62039 (trunk): compile.c: unnecessary freezing — Eric Wong <normalperson@...>
nobu@ruby-lang.org wrote:
5 messages
2018/02/03
[#85612] Why require autoconf 2.67+ — leam hall <leamhall@...>
Please pardon the intrusion; I am new to Ruby and like to pull the
6 messages
2018/02/17
[#85634] [Ruby trunk Bug#14494] [PATCH] tool/m4/ruby_replace_type.m4 use AC_CHECK_TYPES for HAVE_* macros — normalperson@...
Issue #14494 has been reported by normalperson (Eric Wong).
3 messages
2018/02/19
[#85674] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — matz@...
Issue #13618 has been updated by matz (Yukihiro Matsumoto).
5 messages
2018/02/20
[#85686] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2018/02/20
matz@ruby-lang.org wrote:
[#85704] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Koichi Sasada <ko1@...>
2018/02/21
On 2018/02/20 18:06, Eric Wong wrote:
[ruby-core:85839] [Ruby trunk Bug#14127][Rejected] (CSV) generating UTF-16LE encoded file without BOM
From:
kou@...
Date:
2018-02-27 03:14:24 UTC
List:
ruby-core #85839
Issue #14127 has been updated by kou (Kouhei Sutou).
Status changed from Assigned to Rejected
nobu almost said.
You should write BOM by yourself when you use `CSV.generate`.
If you don't want to write BOM by yourself, you should use `CSV.open(..., "w:UTF-16")`:
```ruby
CSV.open("utf16.csv", "w:UTF-16:utf-8") do |csv|
csv << ['something', 'トセナ。ト最・ナセテステ。テュテゥ']
end
```
But it generates big-endian UTF-16.
----------------------------------------
Bug #14127: (CSV) generating UTF-16LE encoded file without BOM
https://bugs.ruby-lang.org/issues/14127#change-70698
* Author: laykou (Ladislav Gallay)
* Status: Rejected
* Priority: Normal
* Assignee: kou (Kouhei Sutou)
* Target version:
* ruby -v: 2.4.1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
This file should contain BOM information so that it is properly detected as UTF-16LE file.
How to generate such file:
~~~ruby
file = CSV.generate(encoding: 'UTF-16LE') do |csv|
csv << ['something', 'トセナ。ト最・ナセテステ。テュテゥ']
end
~~~
According to `file -I file.csv` this file is recognized as `application/octet-stream; charset=binary` because it is missing the BOM information.
According to Wikipedia https://en.wikipedia.org/wiki/UTF-16 it should contain "\xFF\xFE" on the beginning of the document so that everyone knows iths UTF-16LE.
Here is someone trying to fix this in the similiar way: https://stackoverflow.com/a/22950912/1632815 I did it: manually adding that BOM information.
~~~ ruby
## Adds BOM, albeit in a somewhat hacky way.
new_html_file = File.open(foo.txt, "w:UTF-8")
new_html_file << "\xFF\xFE".force_encoding('utf-16le') + some_text.force_encoding('utf-8').encode('utf-16le')
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>