[ruby-core:80254] [Ruby trunk Bug#13321] String#codepoints for one-byte encodings

From: ruby-lang@...
Date: 2017-03-20 19:30:11 UTC
List: ruby-core #80254
Issue #13321 has been updated by InfraRuby (InfraRuby Vision).


Thanks!

----------------------------------------
Bug #13321: String#codepoints for one-byte encodings
https://bugs.ruby-lang.org/issues/13321#change-63692

* Author: InfraRuby (InfraRuby Vision)
* Status: Rejected
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
On many versions of Ruby, including 2.4.0:

    "\x80".force_encoding("WINDOWS-1252").codepoints.first # => 0x80

I expected 0x20AC: https://en.wikipedia.org/wiki/Windows-1252

See:
  https://github.com/ruby/ruby/blob/v2_4_0/string.c#L7817-L7818
  https://github.com/ruby/ruby/blob/v2_4_0/string.c#L422-L424




-- 
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>

In This Thread

Prev Next