Module stringsext::finding
source · Expand description
Store string-findings and prepare them for output.
Structs§
Finding
represents a valid result string decoded to UTF-8 with it’s original location and its original encoding in the input stream.
Enums§
- Used to express the precision of
Finding::position
when the algorithm can not determine its exact position.
Constants§
OUTPUT_BUF_LEN
needs to be long enough to hold all findings that are decoded to UTF-8 inscan::scan()
. To estimate the space needed to receive all decodings in UTF-8, the worst case - Asian likeEUC_JP
- has to be taken into consideration: Therefor, in order to avoid output buffer overflow,OUTPUT_BUF_LEN
should be at least twice as big asINPUT_BUF_LEN
. You can also check the minimum length withDecoder::max_utf8_buffer_length_without_replacement
. Unfortunately this can not be done programmatically, becauseoutput_buffer
is a statically allocated array.- Extra space in bytes for
ByteCounter
and encoding-name whenFinding::print()
prints aFinding
.