Blyx Nest Blyx language
Registry / Library
library · v0.1.0

UTF-8 Stream

Validate UTF-8 incrementally across input buffers and detect truncated sequences at end of input.

Source repository · Package JSON

Use UTF-8 Stream

use vendor::utf8_stream::utf8_stream;

Run the example

nest demo utf8_stream@0.1.0
blyxc native-run utf8_stream-demo/main.blyx
Example source and expected output
use vendor::utf8_stream::utf8_stream;

fn main() {
    let lead = utf8_step(0, 226);
    println!(utf8_complete(lead));
    let tail = utf8_step(utf8_step(lead, 130), 172);
    println!(utf8_complete(tail));
    println!(utf8_step(utf8_step(0, 237), 160));
}

Expected output

false
true
-1

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP · Browse files6431d2ac06852886e6ff09f9e825ad9a5019bee2d07bf1b5ee86134581dec0596de0658514