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

@@ -17,7 +17,7 @@
use std::collections::HashMap;
use crate::{
common::{BitMatrix, Result},
common::{BitMatrix, Result, CharacterSetECI},
BarcodeFormat, EncodeHintType, EncodeHintValue, Exceptions, Writer,
};
@@ -108,7 +108,7 @@ impl Writer for PDF417Writer {
if let Some(EncodeHintValue::CharacterSet(cs)) =
hints.get(&EncodeHintType::CHARACTER_SET)
{
encoder.setEncoding(encoding::label::encoding_from_whatwg_label(cs));
encoder.setEncoding(CharacterSetECI::getCharacterSetECIByName(cs));
}
if let Some(EncodeHintValue::Pdf417AutoEci(auto_eci_str)) =
hints.get(&EncodeHintType::PDF417_AUTO_ECI)