Ticket #887 (closed defect: fixed)
calling join on an Array of BINARY Strings returns UTF-8, may raise Encoding::CompatibilityError.
| Reported by: | dev@… | Owned by: | lsansonetti@… |
|---|---|---|---|
| Priority: | major | Milestone: | MacRuby 0.8 |
| Component: | MacRuby | Keywords: | |
| Cc: | dev@… |
Description
### Ruby 1.9.2
s = "a".force_encoding("BINARY") # => "a"
s.encoding # => #<Encoding:ASCII-8BIT>
[s, s].join.encoding # => #<Encoding:ASCII-8BIT>
s = "\xA4\x01".force_encoding("BINARY") # => "\xA4\x01"
s.encoding # => #<Encoding:ASCII-8BIT>
[s, s].join.encoding # => #<Encoding:ASCII-8BIT>
### MacRuby 0.7 trunk@4494
s = "a".force_encoding("BINARY") # => "a"
s.encoding # => #<Encoding:ASCII-8BIT>
[s, s].join.encoding # => #<Encoding:UTF-8>
s = "\xA4\x01".force_encoding("BINARY") # => "\xA4\x01"
s.encoding # => #<Encoding:ASCII-8BIT>
[s, s].join.encoding # Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT
Change History
Note: See
TracTickets for help on using
tickets.

