Skip to content

Stdin.readByte is broken. #17

Open
@mhermier

Description

@mhermier

Hi,
When usin Stdin.readByte it incorrectly read bytes depending on the value of the previously byte read.
If you look at the code:

static readByte() {
  return read_ {
    // Peel off the first byte.
    var byte = __buffered.bytes[0] // This operates on bytes
    __buffered = __buffered[1..-1] // This operates on UTF8 strings
    return byte
  }
}

Meaning that for every byte values > 127 the whole utf8 character is skipped instead of a single byte.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions