Skip to content

Commit

Permalink
Rename the rest of CPxxx charsets to IBMxxx
Browse files Browse the repository at this point in the history
  • Loading branch information
okarmazin committed Sep 18, 2024
1 parent 9c98cde commit 5821008
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ suspend fun awaitPrint(): MyError? {
val libraryError: PrintError? = connection.print(configuration) { // (2)
// MULTIPLE TEXT ALIGNMENTS PER LINE
line("Famous bridges:")
charset(Charset.CP865) // Can encode Ø, but not ů
charset(IBM865) // Can encode Ø, but not ů
segmentedLine(
LineSegment("Øresundsbroen", TextAlignment.LEFT),
LineSegment("7845m", TextAlignment.RIGHT),
)
charset(Charset.CP852) // Can encode ů, but not Ø
charset(IBM852) // Can encode ů, but not Ø
segmentedLine(
LineSegment("Karlův most", TextAlignment.LEFT),
LineSegment("515m", TextAlignment.RIGHT),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ import cz.multiplatform.escpos4k.core.encoding.charset.Charset
* val builder = CommandBuilder(defaultConfig) {
* // Charsets
* line("Famous bridges:")
* charset(Charset.CP865) // Can encode Ø, but not ů
* charset(IBM865) // Can encode Ø, but not ů
* line("Øresundsbroen: 7845m")
* charset(Charset.CP852) // Can encode ů, but not Ø
* charset(IBM852) // Can encode ů, but not Ø
* line("Karlův most: 515m")
*
* // Text style - temporary style builder
Expand Down Expand Up @@ -163,10 +163,10 @@ public class CommandBuilder(
* printer.print {
* line("Famous bridges:")
*
* charset(Charset.CP865) // Can encode Ø, but not ů
* charset(IBM865) // Can encode Ø, but not ů
* line("Øresundsbroen: 7845m")
*
* charset(Charset.CP852) // Can encode ů, but not Ø
* charset(IBM852) // Can encode ů, but not Ø
* line("Karlův most: 515m")
* }
* ```
Expand All @@ -193,10 +193,10 @@ public class CommandBuilder(
* line("Famous bridges")
*
* // 865 can encode Ø, but not ů
* charset(Charset.CP865)
* charset(IBM865)
* line("Øresundsbroen: 7845m")
*
* withCharset(Charset.CP852) {
* withCharset(IBM852) {
* // 852 can encode ů, but not Ø
* line("Karlův most: 515m")
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 33 [CP775: Baltic Rim] */
public data object CP775 : Charset(33, "IBM775") {
public data object IBM775 : Charset(33, "IBM775") {
override val mapping: Map<Char, Int> =
mapOf(
'\u0106' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 18 [CP852: Latin 2] */
public data object CP852 : Charset(18, "IBM852") {
public data object IBM852 : Charset(18, "IBM852") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 34 [CP855: Cyrillic] */
public data object CP855 : Charset(34, "IBM855") {
public data object IBM855 : Charset(34, "IBM855") {
override val mapping: Map<Char, Int> =
mapOf(
'\u0452' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 13 [CP857: Turkish] */
public data object CP857 : Charset(13, "IBM857") {
public data object IBM857 : Charset(13, "IBM857") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 19 [CP858: Euro] */
public data object CP858 : Charset(19, "IBM00858") { // Note: two leading zeros
public data object IBM858 : Charset(19, "IBM00858") { // Note: two leading zeros
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 3 [CP860: Portuguese] */
public data object CP860 : Charset(3, "IBM860") {
public data object IBM860 : Charset(3, "IBM860") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 35 [CP861: Icelandic] */
public data object CP861 : Charset(35, "IBM861") {
public data object IBM861 : Charset(35, "IBM861") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 36 [CP862: Hebrew] */
public data object CP862 : Charset(36, "IBM862") {
public data object IBM862 : Charset(36, "IBM862") {
override val mapping: Map<Char, Int> =
mapOf(
'\u05D0' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 4 [CP863: Canadian-French] */
public data object CP863 : Charset(4, "IBM863") {
public data object IBM863 : Charset(4, "IBM863") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 37 [CP864: Arabic] */
public data object CP864 : Charset(37, "IBM864") {
public data object IBM864 : Charset(37, "IBM864") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00B0' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 5 [CP865: Nordic] */
public data object CP865 : Charset(5, "IBM865") {
public data object IBM865 : Charset(5, "IBM865") {
override val mapping: Map<Char, Int> =
mapOf(
'\u00C7' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 17 [CP866: Cyrillic #2] */
public data object CP866 : Charset(17, "IBM866") {
public data object IBM866 : Charset(17, "IBM866") {
override val mapping: Map<Char, Int> =
mapOf(
'\u0410' to 0x80,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package cz.multiplatform.escpos4k.core.encoding.charset

/** Page 38 [CP869: Greek] */
public data object CP869 : Charset(38, "IBM869") {
public data object IBM869 : Charset(38, "IBM869") {
override val mapping: Map<Char, Int> =
mapOf(
'\uFFFD' to 0x80,
Expand Down

0 comments on commit 5821008

Please sign in to comment.