Removed checking for charset, it seems to work without
This commit is contained in:
parent
e4a8a79ee3
commit
1ed96fce7d
|
@ -103,14 +103,7 @@ class QrCodeImageAnalyzer(private val resultCallback: (QrCodeReadResult) -> Unit
|
||||||
val result = reader.decode(bitmap, readerHints)
|
val result = reader.decode(bitmap, readerHints)
|
||||||
|
|
||||||
if (result != null && result.text != null) {
|
if (result != null && result.text != null) {
|
||||||
val decodeResult = DI.epcQrCodeService.decode(result.text)
|
|
||||||
if (decodeResult.charset == null || decodeResult.charset == "UTF-8") {
|
|
||||||
this.resultCallback(QrCodeReadResult(result.text))
|
this.resultCallback(QrCodeReadResult(result.text))
|
||||||
} else { // the charset for receiver name, reference, ... was not UTF-8 -> decode image in EPC QR Code's charset
|
|
||||||
val resultForEncoding = reader.decode(bitmap, readerHintsForCharset(decodeResult.charset))
|
|
||||||
|
|
||||||
this.resultCallback(QrCodeReadResult(resultForEncoding?.text ?: result.text))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
if (e !is NotFoundException) {
|
if (e !is NotFoundException) {
|
||||||
|
|
Loading…
Reference in New Issue