Skip to main content

qubit_text_codec/codec/
unmappable_action.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10/// Policy used when a character cannot be represented by the target charset.
11#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
12pub enum UnmappableAction {
13    /// Return the unmappable-character error to the caller.
14    Report,
15
16    /// Skip the unmappable character and continue.
17    Ignore,
18
19    /// Encode the configured replacement character instead.
20    #[default]
21    Replace,
22}