mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
several backported fixes (some are not supported and are not included in tests)
This commit is contained in:
@@ -106,9 +106,7 @@ impl ECIStringBuilder {
|
||||
pub fn appendECI(&mut self, value: u32) -> Result<(), Exceptions> {
|
||||
self.encodeCurrentBytesIfAny();
|
||||
let character_set_eci = CharacterSetECI::getCharacterSetECIByValue(value)?;
|
||||
// if (character_set_eci == null) {
|
||||
// throw FormatException.getFormatInstance();
|
||||
// }
|
||||
|
||||
self.current_charset = CharacterSetECI::getCharset(&character_set_eci);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ fn decodeECISegment(bits: &mut BitSource, result: &mut ECIStringBuilder) -> Resu
|
||||
|
||||
let secondByte = bits.readBits(8)?;
|
||||
if firstByte <= 191 {
|
||||
return result.appendECI(firstByte - 1);
|
||||
return result.appendECI((firstByte - 128) * 254 + 127 + secondByte - 1);
|
||||
}
|
||||
|
||||
let thirdByte = bits.readBits(8)?;
|
||||
|
||||
Reference in New Issue
Block a user