Project

General

Profile

Feature #1667

IO#codepoints, IO#each_codepoint, and StringIO

Added by marcandre (Marc-Andre Lafortune) over 10 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:23949]

Description

Almost all "iterators" of String are present in IO and StringIO: #each_char, #each_byte, #each_line and their corresponding #chars, #bytes, #lines. Only #each_codepoint and #codepoints are not defined in IO and StringIO.

Unless there is a compelling reason not to, it would be useful if these were defined. This would mirror the coherence with all other each_* methods that exist in both String, IO and StringIO.


Related issues

Related to Ruby master - Bug #11444: STDIN.each_codepoint hangs indefinitely on certain codepointsClosedActions

History

#1

Updated by matz (Yukihiro Matsumoto) over 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r23818.

#2

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Related to Bug #11444: STDIN.each_codepoint hangs indefinitely on certain codepoints added
#3

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Description updated (diff)

Why is "an incomplete character before EOF" ignored?

        if (more_char(fptr) == MORE_CHAR_FINISHED) {
            clear_readconv(fptr);
            /* ignore an incomplete character before EOF */
            return io;
        }

Also available in: Atom PDF