6.63. kink/io/INPUT_SCANNER

Provides a `scanner` implementation wrapping `input`.

6.63.1. INPUT_SCANNER.new(Input Charset ...[$config={}])

`new` makes a `scanner` which also support `input` methods. The created scanner reads bytes from `Input` and converts them to strings using `Charset`. Methods of `input` type are delegated to `Input`.

Config method:

• C.replace_conversion_error

When `scan_line` or `scan` methods detect malformed byte sequence or a character which cannot be mapped to Unicode, those methods tail-call $error by default. If C.replace_conversion_error is called, `scan` and `scan_line` insert replacement character sequence into the string instead of calling $error.

Preconditions

`Input` must be `input` type.

`Charset` must be `charset` type.

Example