# encoding_rs::mem::copy_ascii_to_basic_latin - Rust
API documentation for the Rust `copy_ascii_to_basic_latin` fn in crate `encoding_rs`.
Keywords: rust, rustlang, rust-lang, copy_ascii_to_basic_latin

# [−] [src] Function encoding_rs::mem::copy_ascii_to_basic_latin

    pub fn copy_ascii_to_basic_latin(src: &[u8], dst: &mut [u16]) -> usize

Copies ASCII from source to destination zero-extending it to UTF-16 up to the first non-ASCII byte (or the end of the input if it is ASCII in its entirety).

The length of the destination buffer must be at least the length of the source buffer.

Returns the number of `u16`s written.

# Panics

Panics if the destination buffer is shorter than stated above.