Fixed generating EPC QR Codes with UTF-8 values
This commit is contained in:
parent
a928f04fa6
commit
13d01a6be3
|
@ -16,8 +16,9 @@ open class EpcQrCodeGenerator {
|
||||||
open fun generateEpcQrCode(config: EpcQrCodeConfig): EpcQrCode {
|
open fun generateEpcQrCode(config: EpcQrCodeConfig): EpcQrCode {
|
||||||
val heightAndWidth = config.qrCodeHeightAndWidth
|
val heightAndWidth = config.qrCodeHeightAndWidth
|
||||||
val epcQrCodeContent = generateAsString(config)
|
val epcQrCodeContent = generateAsString(config)
|
||||||
|
val epcQrCodeContentBytes = epcQrCodeContent.encodeToByteArray() // qrCode.msg() contains a bug for UTF-8 characters -> encode manually to bytes
|
||||||
|
|
||||||
val qrCodeBitmap = qrCode.msg(epcQrCodeContent)
|
val qrCodeBitmap = qrCode.msg(epcQrCodeContentBytes)
|
||||||
.scaled(heightAndWidth, heightAndWidth, true)
|
.scaled(heightAndWidth, heightAndWidth, true)
|
||||||
|
|
||||||
val qrCodeBytes = convertToFormat(qrCodeBitmap, config.imageFormat)
|
val qrCodeBytes = convertToFormat(qrCodeBitmap, config.imageFormat)
|
||||||
|
|
Loading…
Reference in New Issue