pub fn encode_string(
encoding: Encoding,
data: &str,
check: bool,
) -> Result<Vec<u8>, Error>
Expand description
Encodes a string to a byte vector using the specified encoding.
check
- If true, checks for encoding errors and returns an error if any.