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