okarmazin / escpos4k

ESC/POS for Kotlin Multiplatform
Apache License 2.0
11 stars 1 forks source link

Charset issue #35

Closed Knoxvillekm closed 1 month ago

Knoxvillekm commented 9 months ago

Every printer has own list supported charsets with difference Id. For example: one printer has Windows1252 with id - 16 and other has Windows1252 with - 87.

Idea: enum of charsetNames

enum class Charset(
    CP437("IBM437")
    CP850("IBM850")
    CP860("IBM860")
    ...
)

and charset data class

data class CharsetEncoding(
    val charsetId: Byte,
    val charsetName/charset: String/Charset,
)

And ktor has charset class import io.ktor.utils.io.charsets.Charset

okarmazin commented 9 months ago

Alright, so current implementation is only compatible with Epson printers, because it is coded to the Epson ESC/POS specification. I didn't encounter this issue, because I tested the charsets on an Epson printer.

This needs to be reworked.

okarmazin commented 1 month ago

Superseded by #41