1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use crateSdmpError;
/// Encode a string as raw UTF-8 bytes (passthrough, no compression).
///
/// This is the SDMP-8 codec: the output is identical to the input's
/// UTF-8 byte representation.
///
/// # Examples
///
/// ```rust
/// use srcdmp::raw::codec::sdmp8::encode;
///
/// assert_eq!(encode("hello"), b"hello");
/// ```
/// Decode raw UTF-8 bytes back into a string (SDMP-8 passthrough).
///
/// # Errors
///
/// Returns [`SdmpError::InvalidUtf8`] if the byte sequence is not
/// valid UTF-8.
///
/// # Examples
///
/// ```rust
/// use srcdmp::raw::codec::sdmp8::decode;
///
/// assert_eq!(decode(b"hello").unwrap(), "hello");
/// assert!(decode(b"\xff\xfe").is_err());
/// ```