repurpose CharacterSetECI as encoding abstraction

This commit is contained in:
Henry Schimke
2023-03-02 15:50:56 -06:00
parent c4fec7d2ee
commit a0b8b68869
29 changed files with 304 additions and 337 deletions

View File

@@ -16,13 +16,12 @@
use std::{fmt, rc::Rc};
use encoding::EncodingRef;
use unicode_segmentation::UnicodeSegmentation;
use crate::common::Result;
use crate::Exceptions;
use super::{ECIEncoderSet, ECIInput};
use super::{ECIEncoderSet, ECIInput, CharacterSetECI};
//* approximated (latch + 2 codewords)
pub const COST_PER_ECI: usize = 3;
@@ -194,7 +193,7 @@ impl MinimalECIInput {
*/
pub fn new(
stringToEncodeInput: &str,
priorityCharset: Option<EncodingRef>,
priorityCharset: Option<CharacterSetECI>,
fnc1: Option<&str>,
) -> Self {
let stringToEncode = stringToEncodeInput.graphemes(true).collect::<Vec<&str>>();