From bca05097072990640ac0e6adaef3138bda82f031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Sun, 28 Jan 2024 14:57:08 +0100 Subject: [PATCH 01/34] Commonize character encoding --- .../cz/multiplatform/escpos4k/core/Charset.kt | 3649 ++++++++++++++++- .../cz/multiplatform/escpos4k/core/Command.kt | 2 +- .../cz/multiplatform/escpos4k/core/Encoder.kt | 44 + 3 files changed, 3650 insertions(+), 45 deletions(-) diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt index d34a26b..a9af839 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt @@ -16,8 +16,7 @@ package cz.multiplatform.escpos4k.core -public enum class Charset( - +public sealed class Charset( /** * Code page number according to ESC/POS specification. * @@ -30,25 +29,690 @@ public enum class Charset( * * https://www.iana.org/assignments/character-sets/character-sets.xhtml */ - public val ianaName: String, + public val ianaName: String ) { + public companion object { + internal val default = CP437 + } + + internal abstract val mapping: Map + /** Page 0 [CP437: USA, Standard Europe] */ - CP437(0, "IBM437"), + public data object CP437 : Charset(0, "IBM437") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00A5' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF) + } // /** Page 1 [Katakana] */ // Katakana(1, TODO()), /** Page 2 [CP850: Multilingual] */ - CP850(2, "IBM850"), + public data object CP850 : Charset(2, "IBM850") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u00D7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u00C0' to 0xB7, + '\u00A9' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u00A2' to 0xBD, + '\u00A5' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u00E3' to 0xC6, + '\u00C3' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u00F0' to 0xD0, + '\u00D0' to 0xD1, + '\u00CA' to 0xD2, + '\u00CB' to 0xD3, + '\u00C8' to 0xD4, + '\u0131' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u00CF' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u00A6' to 0xDD, + '\u00CC' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u00D2' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\u00FE' to 0xE7, + '\u00DE' to 0xE8, + '\u00DA' to 0xE9, + '\u00DB' to 0xEA, + '\u00D9' to 0xEB, + '\u00FD' to 0xEC, + '\u00DD' to 0xED, + '\u00AF' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u2017' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 3 [CP860: Portuguese] */ - CP860(3, "IBM860"), + public data object CP860 : Charset(3, "IBM860") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E3' to 0x84, + '\u00E0' to 0x85, + '\u00C1' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00CA' to 0x89, + '\u00E8' to 0x8A, + '\u00CD' to 0x8B, + '\u00D4' to 0x8C, + '\u00EC' to 0x8D, + '\u00C3' to 0x8E, + '\u00C2' to 0x8F, + '\u00C9' to 0x90, + '\u00C0' to 0x91, + '\u00C8' to 0x92, + '\u00F4' to 0x93, + '\u00F5' to 0x94, + '\u00F2' to 0x95, + '\u00DA' to 0x96, + '\u00F9' to 0x97, + '\u00CC' to 0x98, + '\u00D5' to 0x99, + '\u00DC' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00D9' to 0x9D, + '\u20A7' to 0x9E, + '\u00D3' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u00D2' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 4 [CP863: Canadian-French] */ - CP863(4, "IBM863"), + public data object CP863 : Charset(4, "IBM863") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00C2' to 0x84, + '\u00E0' to 0x85, + '\u00B6' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u2017' to 0x8D, + '\u00C0' to 0x8E, + '\u00A7' to 0x8F, + '\u00C9' to 0x90, + '\u00C8' to 0x91, + '\u00CA' to 0x92, + '\u00F4' to 0x93, + '\u00CB' to 0x94, + '\u00CF' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00A4' to 0x98, + '\u00D4' to 0x99, + '\u00DC' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00D9' to 0x9D, + '\u00DB' to 0x9E, + '\u0192' to 0x9F, + '\u00A6' to 0xA0, + '\u00B4' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00A8' to 0xA4, + '\u00B8' to 0xA5, + '\u00B3' to 0xA6, + '\u00AF' to 0xA7, + '\u00CE' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00BE' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 5 [CP865: Nordic] */ - CP865(5, "IBM865"), + public data object CP865 : Charset(5, "IBM865") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00A4' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } // /** Page 6 [Hiragana] */ // Hiragana(6, TODO()), @@ -59,32 +723,824 @@ public enum class Charset( // /** Page 8 [One-pass printing Kanji characters] */ // Kanji_2(8, TODO()), - /** Page 11 [CP851: Greek] */ - CP851(11, "IBM851"), + // /** Page 11 [CP851: Greek] */ + // CP851(11, "IBM851"), - /** Page 12 [CP853: Turkish] */ - CP853(12, "IBM853"), + // /** Page 12 [CP853: Turkish] */ + // CP853(12, "IBM853"), - // /** Page 13 [CP857: Turkish] */ - // CP857(13, TODO()), + /** Page 13 [CP857: Turkish] */ + public data object CP857 : Charset(13, "IBM857") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u0131' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u0130' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u015E' to 0x9E, + '\u015F' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u011E' to 0xA6, + '\u011F' to 0xA7, + '\u00BF' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u00C0' to 0xB7, + '\u00A9' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u00A2' to 0xBD, + '\u00A5' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u00E3' to 0xC6, + '\u00C3' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u00BA' to 0xD0, + '\u00AA' to 0xD1, + '\u00CA' to 0xD2, + '\u00CB' to 0xD3, + '\u00C8' to 0xD4, + '\uFFFD' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u00CF' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u00A6' to 0xDD, + '\u00CC' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u00D2' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\uFFFD' to 0xE7, + '\u00D7' to 0xE8, + '\u00DA' to 0xE9, + '\u00DB' to 0xEA, + '\u00D9' to 0xEB, + '\u00EC' to 0xEC, + '\u00FF' to 0xED, + '\u00AF' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\uFFFD' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), /** Page 15 [ISO8859-7: Greek] */ - ISO_8859_7(15, "ISO-8859-7"), + public data object ISO_8859_7 : Charset(15, "ISO-8859-7") { + override val mapping: Map = + mapOf( + '\u0080' to 0x80, + '\u0081' to 0x81, + '\u0082' to 0x82, + '\u0083' to 0x83, + '\u0084' to 0x84, + '\u0085' to 0x85, + '\u0086' to 0x86, + '\u0087' to 0x87, + '\u0088' to 0x88, + '\u0089' to 0x89, + '\u008A' to 0x8A, + '\u008B' to 0x8B, + '\u008C' to 0x8C, + '\u008D' to 0x8D, + '\u008E' to 0x8E, + '\u008F' to 0x8F, + '\u0090' to 0x90, + '\u0091' to 0x91, + '\u0092' to 0x92, + '\u0093' to 0x93, + '\u0094' to 0x94, + '\u0095' to 0x95, + '\u0096' to 0x96, + '\u0097' to 0x97, + '\u0098' to 0x98, + '\u0099' to 0x99, + '\u009A' to 0x9A, + '\u009B' to 0x9B, + '\u009C' to 0x9C, + '\u009D' to 0x9D, + '\u009E' to 0x9E, + '\u009F' to 0x9F, + '\u00A0' to 0xA0, + '\u2018' to 0xA1, + '\u2019' to 0xA2, + '\u00A3' to 0xA3, + '\u20AC' to 0xA4, + '\u20AF' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u037A' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\uFFFD' to 0xAE, + '\u2015' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u0384' to 0xB4, + '\u0385' to 0xB5, + '\u0386' to 0xB6, + '\u00B7' to 0xB7, + '\u0388' to 0xB8, + '\u0389' to 0xB9, + '\u038A' to 0xBA, + '\u00BB' to 0xBB, + '\u038C' to 0xBC, + '\u00BD' to 0xBD, + '\u038E' to 0xBE, + '\u038F' to 0xBF, + '\u0390' to 0xC0, + '\u0391' to 0xC1, + '\u0392' to 0xC2, + '\u0393' to 0xC3, + '\u0394' to 0xC4, + '\u0395' to 0xC5, + '\u0396' to 0xC6, + '\u0397' to 0xC7, + '\u0398' to 0xC8, + '\u0399' to 0xC9, + '\u039A' to 0xCA, + '\u039B' to 0xCB, + '\u039C' to 0xCC, + '\u039D' to 0xCD, + '\u039E' to 0xCE, + '\u039F' to 0xCF, + '\u03A0' to 0xD0, + '\u03A1' to 0xD1, + '\uFFFD' to 0xD2, + '\u03A3' to 0xD3, + '\u03A4' to 0xD4, + '\u03A5' to 0xD5, + '\u03A6' to 0xD6, + '\u03A7' to 0xD7, + '\u03A8' to 0xD8, + '\u03A9' to 0xD9, + '\u03AA' to 0xDA, + '\u03AB' to 0xDB, + '\u03AC' to 0xDC, + '\u03AD' to 0xDD, + '\u03AE' to 0xDE, + '\u03AF' to 0xDF, + '\u03B0' to 0xE0, + '\u03B1' to 0xE1, + '\u03B2' to 0xE2, + '\u03B3' to 0xE3, + '\u03B4' to 0xE4, + '\u03B5' to 0xE5, + '\u03B6' to 0xE6, + '\u03B7' to 0xE7, + '\u03B8' to 0xE8, + '\u03B9' to 0xE9, + '\u03BA' to 0xEA, + '\u03BB' to 0xEB, + '\u03BC' to 0xEC, + '\u03BD' to 0xED, + '\u03BE' to 0xEE, + '\u03BF' to 0xEF, + '\u03C0' to 0xF0, + '\u03C1' to 0xF1, + '\u03C2' to 0xF2, + '\u03C3' to 0xF3, + '\u03C4' to 0xF4, + '\u03C5' to 0xF5, + '\u03C6' to 0xF6, + '\u03C7' to 0xF7, + '\u03C8' to 0xF8, + '\u03C9' to 0xF9, + '\u03CA' to 0xFA, + '\u03CB' to 0xFB, + '\u03CC' to 0xFC, + '\u03CD' to 0xFD, + '\u03CE' to 0xFE, + '\uFFFD' to 0xFF, + ) + } /** Page 16 [Windows-1252] */ - Windows1252(16, "windows-1252"), + public data object Windows1252 : Charset(16, "windows-1252") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\u0160' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\uFFFD' to 0x8D, + '\u017D' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\u0161' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\uFFFD' to 0x9D, + '\u017E' to 0x9E, + '\u0178' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u00C3' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u00CC' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u00D0' to 0xD0, + '\u00D1' to 0xD1, + '\u00D2' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u00DE' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u00E3' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u00EC' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u00F0' to 0xF0, + '\u00F1' to 0xF1, + '\u00F2' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u00FE' to 0xFE, + '\u00FF' to 0xFF, + ) + } /** Page 17 [CP866: Cyrillic #2] */ - CP866(17, "IBM866"), + public data object CP866 : Charset(17, "IBM866") { + override val mapping: Map = + mapOf( + '\u0410' to 0x80, + '\u0411' to 0x81, + '\u0412' to 0x82, + '\u0413' to 0x83, + '\u0414' to 0x84, + '\u0415' to 0x85, + '\u0416' to 0x86, + '\u0417' to 0x87, + '\u0418' to 0x88, + '\u0419' to 0x89, + '\u041A' to 0x8A, + '\u041B' to 0x8B, + '\u041C' to 0x8C, + '\u041D' to 0x8D, + '\u041E' to 0x8E, + '\u041F' to 0x8F, + '\u0420' to 0x90, + '\u0421' to 0x91, + '\u0422' to 0x92, + '\u0423' to 0x93, + '\u0424' to 0x94, + '\u0425' to 0x95, + '\u0426' to 0x96, + '\u0427' to 0x97, + '\u0428' to 0x98, + '\u0429' to 0x99, + '\u042A' to 0x9A, + '\u042B' to 0x9B, + '\u042C' to 0x9C, + '\u042D' to 0x9D, + '\u042E' to 0x9E, + '\u042F' to 0x9F, + '\u0430' to 0xA0, + '\u0431' to 0xA1, + '\u0432' to 0xA2, + '\u0433' to 0xA3, + '\u0434' to 0xA4, + '\u0435' to 0xA5, + '\u0436' to 0xA6, + '\u0437' to 0xA7, + '\u0438' to 0xA8, + '\u0439' to 0xA9, + '\u043A' to 0xAA, + '\u043B' to 0xAB, + '\u043C' to 0xAC, + '\u043D' to 0xAD, + '\u043E' to 0xAE, + '\u043F' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u0440' to 0xE0, + '\u0441' to 0xE1, + '\u0442' to 0xE2, + '\u0443' to 0xE3, + '\u0444' to 0xE4, + '\u0445' to 0xE5, + '\u0446' to 0xE6, + '\u0447' to 0xE7, + '\u0448' to 0xE8, + '\u0449' to 0xE9, + '\u044A' to 0xEA, + '\u044B' to 0xEB, + '\u044C' to 0xEC, + '\u044D' to 0xED, + '\u044E' to 0xEE, + '\u044F' to 0xEF, + '\u0401' to 0xF0, + '\u0451' to 0xF1, + '\u0404' to 0xF2, + '\u0454' to 0xF3, + '\u0407' to 0xF4, + '\u0457' to 0xF5, + '\u040E' to 0xF6, + '\u045E' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u2116' to 0xFC, + '\u00A4' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 18 [CP852: Latin 2] */ - CP852(18, "IBM852"), + public data object CP852 : Charset(18, "IBM852") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u016F' to 0x85, + '\u0107' to 0x86, + '\u00E7' to 0x87, + '\u0142' to 0x88, + '\u00EB' to 0x89, + '\u0150' to 0x8A, + '\u0151' to 0x8B, + '\u00EE' to 0x8C, + '\u0179' to 0x8D, + '\u00C4' to 0x8E, + '\u0106' to 0x8F, + '\u00C9' to 0x90, + '\u0139' to 0x91, + '\u013A' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u013D' to 0x95, + '\u013E' to 0x96, + '\u015A' to 0x97, + '\u015B' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u0164' to 0x9B, + '\u0165' to 0x9C, + '\u0141' to 0x9D, + '\u00D7' to 0x9E, + '\u010D' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u0104' to 0xA4, + '\u0105' to 0xA5, + '\u017D' to 0xA6, + '\u017E' to 0xA7, + '\u0118' to 0xA8, + '\u0119' to 0xA9, + '\u00AC' to 0xAA, + '\u017A' to 0xAB, + '\u010C' to 0xAC, + '\u015F' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u011A' to 0xB7, + '\u015E' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u017B' to 0xBD, + '\u017C' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u0102' to 0xC6, + '\u0103' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u0111' to 0xD0, + '\u0110' to 0xD1, + '\u010E' to 0xD2, + '\u00CB' to 0xD3, + '\u010F' to 0xD4, + '\u0147' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u011B' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u0162' to 0xDD, + '\u016E' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u0143' to 0xE3, + '\u0144' to 0xE4, + '\u0148' to 0xE5, + '\u0160' to 0xE6, + '\u0161' to 0xE7, + '\u0154' to 0xE8, + '\u00DA' to 0xE9, + '\u0155' to 0xEA, + '\u0170' to 0xEB, + '\u00FD' to 0xEC, + '\u00DD' to 0xED, + '\u0163' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u02DD' to 0xF1, + '\u02DB' to 0xF2, + '\u02C7' to 0xF3, + '\u02D8' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u02D9' to 0xFA, + '\u0171' to 0xFB, + '\u0158' to 0xFC, + '\u0159' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 19 [CP858: Euro] */ - CP858(19, "IBM00858"), // Note: two leading zeros + public data object CP858 : Charset(19, "IBM00858") { // Note: two leading zeros + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u00D7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u00C0' to 0xB7, + '\u00A9' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u00A2' to 0xBD, + '\u00A5' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u00E3' to 0xC6, + '\u00C3' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u00F0' to 0xD0, + '\u00D0' to 0xD1, + '\u00CA' to 0xD2, + '\u00CB' to 0xD3, + '\u00C8' to 0xD4, + '\u20AC' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u00CF' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u00A6' to 0xDD, + '\u00CC' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u00D2' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\u00FE' to 0xE7, + '\u00DE' to 0xE8, + '\u00DA' to 0xE9, + '\u00DB' to 0xEA, + '\u00D9' to 0xEB, + '\u00FD' to 0xEC, + '\u00DD' to 0xED, + '\u00AF' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u2017' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } // /** Page 20 [Thai Character Code 42] */ // Thai_42(20), @@ -117,28 +1573,1084 @@ public enum class Charset( // CP720(32), /** Page 33 [CP775: Baltic Rim] */ - CP775(33, "IBM775"), + public data object CP775 : Charset(33, "IBM775") { + override val mapping: Map = + mapOf( + '\u0106' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u0101' to 0x83, + '\u00E4' to 0x84, + '\u0123' to 0x85, + '\u00E5' to 0x86, + '\u0107' to 0x87, + '\u0142' to 0x88, + '\u0113' to 0x89, + '\u0156' to 0x8A, + '\u0157' to 0x8B, + '\u012B' to 0x8C, + '\u0179' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u014D' to 0x93, + '\u00F6' to 0x94, + '\u0122' to 0x95, + '\u00A2' to 0x96, + '\u015A' to 0x97, + '\u015B' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u00D7' to 0x9E, + '\u00A4' to 0x9F, + '\u0100' to 0xA0, + '\u012A' to 0xA1, + '\u00F3' to 0xA2, + '\u017B' to 0xA3, + '\u017C' to 0xA4, + '\u017A' to 0xA5, + '\u201D' to 0xA6, + '\u00A6' to 0xA7, + '\u00A9' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u0141' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u0104' to 0xB5, + '\u010C' to 0xB6, + '\u0118' to 0xB7, + '\u0116' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u012E' to 0xBD, + '\u0160' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u0172' to 0xC6, + '\u016A' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u017D' to 0xCF, + '\u0105' to 0xD0, + '\u010D' to 0xD1, + '\u0119' to 0xD2, + '\u0117' to 0xD3, + '\u012F' to 0xD4, + '\u0161' to 0xD5, + '\u0173' to 0xD6, + '\u016B' to 0xD7, + '\u017E' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u014C' to 0xE2, + '\u0143' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\u0144' to 0xE7, + '\u0136' to 0xE8, + '\u0137' to 0xE9, + '\u013B' to 0xEA, + '\u013C' to 0xEB, + '\u0146' to 0xEC, + '\u0112' to 0xED, + '\u0145' to 0xEE, + '\u2019' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u201C' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u201E' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 34 [CP855: Cyrillic] */ - CP855(34, "IBM855"), + public data object CP855 : Charset(34, "IBM855") { + override val mapping: Map = + mapOf( + '\u0452' to 0x80, + '\u0402' to 0x81, + '\u0453' to 0x82, + '\u0403' to 0x83, + '\u0451' to 0x84, + '\u0401' to 0x85, + '\u0454' to 0x86, + '\u0404' to 0x87, + '\u0455' to 0x88, + '\u0405' to 0x89, + '\u0456' to 0x8A, + '\u0406' to 0x8B, + '\u0457' to 0x8C, + '\u0407' to 0x8D, + '\u0458' to 0x8E, + '\u0408' to 0x8F, + '\u0459' to 0x90, + '\u0409' to 0x91, + '\u045A' to 0x92, + '\u040A' to 0x93, + '\u045B' to 0x94, + '\u040B' to 0x95, + '\u045C' to 0x96, + '\u040C' to 0x97, + '\u045E' to 0x98, + '\u040E' to 0x99, + '\u045F' to 0x9A, + '\u040F' to 0x9B, + '\u044E' to 0x9C, + '\u042E' to 0x9D, + '\u044A' to 0x9E, + '\u042A' to 0x9F, + '\u0430' to 0xA0, + '\u0410' to 0xA1, + '\u0431' to 0xA2, + '\u0411' to 0xA3, + '\u0446' to 0xA4, + '\u0426' to 0xA5, + '\u0434' to 0xA6, + '\u0414' to 0xA7, + '\u0435' to 0xA8, + '\u0415' to 0xA9, + '\u0444' to 0xAA, + '\u0424' to 0xAB, + '\u0433' to 0xAC, + '\u0413' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u0445' to 0xB5, + '\u0425' to 0xB6, + '\u0438' to 0xB7, + '\u0418' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u0439' to 0xBD, + '\u0419' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u043A' to 0xC6, + '\u041A' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u043B' to 0xD0, + '\u041B' to 0xD1, + '\u043C' to 0xD2, + '\u041C' to 0xD3, + '\u043D' to 0xD4, + '\u041D' to 0xD5, + '\u043E' to 0xD6, + '\u041E' to 0xD7, + '\u043F' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u041F' to 0xDD, + '\u044F' to 0xDE, + '\u2580' to 0xDF, + '\u042F' to 0xE0, + '\u0440' to 0xE1, + '\u0420' to 0xE2, + '\u0441' to 0xE3, + '\u0421' to 0xE4, + '\u0442' to 0xE5, + '\u0422' to 0xE6, + '\u0443' to 0xE7, + '\u0423' to 0xE8, + '\u0436' to 0xE9, + '\u0416' to 0xEA, + '\u0432' to 0xEB, + '\u0412' to 0xEC, + '\u044C' to 0xED, + '\u042C' to 0xEE, + '\u2116' to 0xEF, + '\u00AD' to 0xF0, + '\u044B' to 0xF1, + '\u042B' to 0xF2, + '\u0437' to 0xF3, + '\u0417' to 0xF4, + '\u0448' to 0xF5, + '\u0428' to 0xF6, + '\u044D' to 0xF7, + '\u042D' to 0xF8, + '\u0449' to 0xF9, + '\u0429' to 0xFA, + '\u0447' to 0xFB, + '\u0427' to 0xFC, + '\u00A7' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 35 [CP861: Icelandic] */ - CP861(35, "IBM861"), + public data object CP861 : Charset(35, "IBM861") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00D0' to 0x8B, + '\u00F0' to 0x8C, + '\u00DE' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00FE' to 0x95, + '\u00FB' to 0x96, + '\u00DD' to 0x97, + '\u00FD' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00C1' to 0xA4, + '\u00CD' to 0xA5, + '\u00D3' to 0xA6, + '\u00DA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 36 [CP862: Hebrew] */ - CP862(36, "IBM862"), + public data object CP862 : Charset(36, "IBM862") { + override val mapping: Map = + mapOf( + '\u05D0' to 0x80, + '\u05D1' to 0x81, + '\u05D2' to 0x82, + '\u05D3' to 0x83, + '\u05D4' to 0x84, + '\u05D5' to 0x85, + '\u05D6' to 0x86, + '\u05D7' to 0x87, + '\u05D8' to 0x88, + '\u05D9' to 0x89, + '\u05DA' to 0x8A, + '\u05DB' to 0x8B, + '\u05DC' to 0x8C, + '\u05DD' to 0x8D, + '\u05DE' to 0x8E, + '\u05DF' to 0x8F, + '\u05E0' to 0x90, + '\u05E1' to 0x91, + '\u05E2' to 0x92, + '\u05E3' to 0x93, + '\u05E4' to 0x94, + '\u05E5' to 0x95, + '\u05E6' to 0x96, + '\u05E7' to 0x97, + '\u05E8' to 0x98, + '\u05E9' to 0x99, + '\u05EA' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00A5' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 37 [CP864: Arabic] */ - CP864(37, "IBM864"), + public data object CP864 : Charset(37, "IBM864") { + override val mapping: Map = + mapOf( + '\u00B0' to 0x80, + '\u00B7' to 0x81, + '\u2219' to 0x82, + '\u221A' to 0x83, + '\u2592' to 0x84, + '\u2500' to 0x85, + '\u2502' to 0x86, + '\u253C' to 0x87, + '\u2524' to 0x88, + '\u252C' to 0x89, + '\u251C' to 0x8A, + '\u2534' to 0x8B, + '\u2510' to 0x8C, + '\u250C' to 0x8D, + '\u2514' to 0x8E, + '\u2518' to 0x8F, + '\u03B2' to 0x90, + '\u221E' to 0x91, + '\u03C6' to 0x92, + '\u00B1' to 0x93, + '\u00BD' to 0x94, + '\u00BC' to 0x95, + '\u2248' to 0x96, + '\u00AB' to 0x97, + '\u00BB' to 0x98, + '\uFEF7' to 0x99, + '\uFEF8' to 0x9A, + '\uFFFD' to 0x9B, + '\uFFFD' to 0x9C, + '\uFEFB' to 0x9D, + '\uFEFC' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\u00AD' to 0xA1, + '\uFE82' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\uFE84' to 0xA5, + '\uFFFD' to 0xA6, + '\uFFFD' to 0xA7, + '\uFE8E' to 0xA8, + '\uFE8F' to 0xA9, + '\uFE95' to 0xAA, + '\uFE99' to 0xAB, + '\u060C' to 0xAC, + '\uFE9D' to 0xAD, + '\uFEA1' to 0xAE, + '\uFEA5' to 0xAF, + '\u0660' to 0xB0, + '\u0661' to 0xB1, + '\u0662' to 0xB2, + '\u0663' to 0xB3, + '\u0664' to 0xB4, + '\u0665' to 0xB5, + '\u0666' to 0xB6, + '\u0667' to 0xB7, + '\u0668' to 0xB8, + '\u0669' to 0xB9, + '\uFED1' to 0xBA, + '\u061B' to 0xBB, + '\uFEB1' to 0xBC, + '\uFEB5' to 0xBD, + '\uFEB9' to 0xBE, + '\u061F' to 0xBF, + '\u00A2' to 0xC0, + '\uFE80' to 0xC1, + '\uFE81' to 0xC2, + '\uFE83' to 0xC3, + '\uFE85' to 0xC4, + '\uFECA' to 0xC5, + '\uFE8B' to 0xC6, + '\uFE8D' to 0xC7, + '\uFE91' to 0xC8, + '\uFE93' to 0xC9, + '\uFE97' to 0xCA, + '\uFE9B' to 0xCB, + '\uFE9F' to 0xCC, + '\uFEA3' to 0xCD, + '\uFEA7' to 0xCE, + '\uFEA9' to 0xCF, + '\uFEAB' to 0xD0, + '\uFEAD' to 0xD1, + '\uFEAF' to 0xD2, + '\uFEB3' to 0xD3, + '\uFEB7' to 0xD4, + '\uFEBB' to 0xD5, + '\uFEBF' to 0xD6, + '\uFEC1' to 0xD7, + '\uFEC5' to 0xD8, + '\uFECB' to 0xD9, + '\uFECF' to 0xDA, + '\u00A6' to 0xDB, + '\u00AC' to 0xDC, + '\u00F7' to 0xDD, + '\u00D7' to 0xDE, + '\uFEC9' to 0xDF, + '\u0640' to 0xE0, + '\uFED3' to 0xE1, + '\uFED7' to 0xE2, + '\uFEDB' to 0xE3, + '\uFEDF' to 0xE4, + '\uFEE3' to 0xE5, + '\uFEE7' to 0xE6, + '\uFEEB' to 0xE7, + '\uFEED' to 0xE8, + '\uFEEF' to 0xE9, + '\uFEF3' to 0xEA, + '\uFEBD' to 0xEB, + '\uFECC' to 0xEC, + '\uFECE' to 0xED, + '\uFECD' to 0xEE, + '\uFEE1' to 0xEF, + '\uFE7D' to 0xF0, + '\u0651' to 0xF1, + '\uFEE5' to 0xF2, + '\uFEE9' to 0xF3, + '\uFEEC' to 0xF4, + '\uFEF0' to 0xF5, + '\uFEF2' to 0xF6, + '\uFED0' to 0xF7, + '\uFED5' to 0xF8, + '\uFEF5' to 0xF9, + '\uFEF6' to 0xFA, + '\uFEDD' to 0xFB, + '\uFED9' to 0xFC, + '\uFEF1' to 0xFD, + '\u25A0' to 0xFE, + '\uFFFD' to 0xFF, + ) + } /** Page 38 [CP869: Greek] */ - CP869(38, "IBM869"), + public data object CP869 : Charset(38, "IBM869") { + override val mapping: Map = + mapOf( + '\uFFFD' to 0x80, + '\uFFFD' to 0x81, + '\uFFFD' to 0x82, + '\uFFFD' to 0x83, + '\uFFFD' to 0x84, + '\uFFFD' to 0x85, + '\u0386' to 0x86, + '\uFFFD' to 0x87, + '\u00B7' to 0x88, + '\u00AC' to 0x89, + '\u00A6' to 0x8A, + '\u2018' to 0x8B, + '\u2019' to 0x8C, + '\u0388' to 0x8D, + '\u2015' to 0x8E, + '\u0389' to 0x8F, + '\u038A' to 0x90, + '\u03AA' to 0x91, + '\u038C' to 0x92, + '\uFFFD' to 0x93, + '\uFFFD' to 0x94, + '\u038E' to 0x95, + '\u03AB' to 0x96, + '\u00A9' to 0x97, + '\u038F' to 0x98, + '\u00B2' to 0x99, + '\u00B3' to 0x9A, + '\u03AC' to 0x9B, + '\u00A3' to 0x9C, + '\u03AD' to 0x9D, + '\u03AE' to 0x9E, + '\u03AF' to 0x9F, + '\u03CA' to 0xA0, + '\u0390' to 0xA1, + '\u03CC' to 0xA2, + '\u03CD' to 0xA3, + '\u0391' to 0xA4, + '\u0392' to 0xA5, + '\u0393' to 0xA6, + '\u0394' to 0xA7, + '\u0395' to 0xA8, + '\u0396' to 0xA9, + '\u0397' to 0xAA, + '\u00BD' to 0xAB, + '\u0398' to 0xAC, + '\u0399' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u039A' to 0xB5, + '\u039B' to 0xB6, + '\u039C' to 0xB7, + '\u039D' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u039E' to 0xBD, + '\u039F' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u03A0' to 0xC6, + '\u03A1' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u03A3' to 0xCF, + '\u03A4' to 0xD0, + '\u03A5' to 0xD1, + '\u03A6' to 0xD2, + '\u03A7' to 0xD3, + '\u03A8' to 0xD4, + '\u03A9' to 0xD5, + '\u03B1' to 0xD6, + '\u03B2' to 0xD7, + '\u03B3' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u03B4' to 0xDD, + '\u03B5' to 0xDE, + '\u2580' to 0xDF, + '\u03B6' to 0xE0, + '\u03B7' to 0xE1, + '\u03B8' to 0xE2, + '\u03B9' to 0xE3, + '\u03BA' to 0xE4, + '\u03BB' to 0xE5, + '\u03BC' to 0xE6, + '\u03BD' to 0xE7, + '\u03BE' to 0xE8, + '\u03BF' to 0xE9, + '\u03C0' to 0xEA, + '\u03C1' to 0xEB, + '\u03C3' to 0xEC, + '\u03C2' to 0xED, + '\u03C4' to 0xEE, + '\u0384' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u03C5' to 0xF2, + '\u03C6' to 0xF3, + '\u03C7' to 0xF4, + '\u00A7' to 0xF5, + '\u03C8' to 0xF6, + '\u0385' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u03C9' to 0xFA, + '\u03CB' to 0xFB, + '\u03B0' to 0xFC, + '\u03CE' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) + } /** Page 39 [ISO8859-2: Latin 2] */ - ISO8859_2(39, "ISO-8859-2"), + public data object ISO_8859_2 : Charset(39, "ISO-8859-2") { + override val mapping: Map = + mapOf( + '\u0080' to 0x80, + '\u0081' to 0x81, + '\u0082' to 0x82, + '\u0083' to 0x83, + '\u0084' to 0x84, + '\u0085' to 0x85, + '\u0086' to 0x86, + '\u0087' to 0x87, + '\u0088' to 0x88, + '\u0089' to 0x89, + '\u008A' to 0x8A, + '\u008B' to 0x8B, + '\u008C' to 0x8C, + '\u008D' to 0x8D, + '\u008E' to 0x8E, + '\u008F' to 0x8F, + '\u0090' to 0x90, + '\u0091' to 0x91, + '\u0092' to 0x92, + '\u0093' to 0x93, + '\u0094' to 0x94, + '\u0095' to 0x95, + '\u0096' to 0x96, + '\u0097' to 0x97, + '\u0098' to 0x98, + '\u0099' to 0x99, + '\u009A' to 0x9A, + '\u009B' to 0x9B, + '\u009C' to 0x9C, + '\u009D' to 0x9D, + '\u009E' to 0x9E, + '\u009F' to 0x9F, + '\u00A0' to 0xA0, + '\u0104' to 0xA1, + '\u02D8' to 0xA2, + '\u0141' to 0xA3, + '\u00A4' to 0xA4, + '\u013D' to 0xA5, + '\u015A' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u0160' to 0xA9, + '\u015E' to 0xAA, + '\u0164' to 0xAB, + '\u0179' to 0xAC, + '\u00AD' to 0xAD, + '\u017D' to 0xAE, + '\u017B' to 0xAF, + '\u00B0' to 0xB0, + '\u0105' to 0xB1, + '\u02DB' to 0xB2, + '\u0142' to 0xB3, + '\u00B4' to 0xB4, + '\u013E' to 0xB5, + '\u015B' to 0xB6, + '\u02C7' to 0xB7, + '\u00B8' to 0xB8, + '\u0161' to 0xB9, + '\u015F' to 0xBA, + '\u0165' to 0xBB, + '\u017A' to 0xBC, + '\u02DD' to 0xBD, + '\u017E' to 0xBE, + '\u017C' to 0xBF, + '\u0154' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u0102' to 0xC3, + '\u00C4' to 0xC4, + '\u0139' to 0xC5, + '\u0106' to 0xC6, + '\u00C7' to 0xC7, + '\u010C' to 0xC8, + '\u00C9' to 0xC9, + '\u0118' to 0xCA, + '\u00CB' to 0xCB, + '\u011A' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u010E' to 0xCF, + '\u0110' to 0xD0, + '\u0143' to 0xD1, + '\u0147' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u0150' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u0158' to 0xD8, + '\u016E' to 0xD9, + '\u00DA' to 0xDA, + '\u0170' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u0162' to 0xDE, + '\u00DF' to 0xDF, + '\u0155' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u0103' to 0xE3, + '\u00E4' to 0xE4, + '\u013A' to 0xE5, + '\u0107' to 0xE6, + '\u00E7' to 0xE7, + '\u010D' to 0xE8, + '\u00E9' to 0xE9, + '\u0119' to 0xEA, + '\u00EB' to 0xEB, + '\u011B' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u010F' to 0xEF, + '\u0111' to 0xF0, + '\u0144' to 0xF1, + '\u0148' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u0151' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u0159' to 0xF8, + '\u016F' to 0xF9, + '\u00FA' to 0xFA, + '\u0171' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u0163' to 0xFE, + '\u02D9' to 0xFF, + ) + } /** Page 40 [ISO8859-15: Latin 9] */ - ISO8859_15(40, "ISO-8859-15"), + public data object ISO_8859_15 : Charset(40, "ISO-8859-15") { + override val mapping: Map = + mapOf( + '\u0080' to 0x80, + '\u0081' to 0x81, + '\u0082' to 0x82, + '\u0083' to 0x83, + '\u0084' to 0x84, + '\u0085' to 0x85, + '\u0086' to 0x86, + '\u0087' to 0x87, + '\u0088' to 0x88, + '\u0089' to 0x89, + '\u008A' to 0x8A, + '\u008B' to 0x8B, + '\u008C' to 0x8C, + '\u008D' to 0x8D, + '\u008E' to 0x8E, + '\u008F' to 0x8F, + '\u0090' to 0x90, + '\u0091' to 0x91, + '\u0092' to 0x92, + '\u0093' to 0x93, + '\u0094' to 0x94, + '\u0095' to 0x95, + '\u0096' to 0x96, + '\u0097' to 0x97, + '\u0098' to 0x98, + '\u0099' to 0x99, + '\u009A' to 0x9A, + '\u009B' to 0x9B, + '\u009C' to 0x9C, + '\u009D' to 0x9D, + '\u009E' to 0x9E, + '\u009F' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u20AC' to 0xA4, + '\u00A5' to 0xA5, + '\u0160' to 0xA6, + '\u00A7' to 0xA7, + '\u0161' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u017D' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u017E' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u0152' to 0xBC, + '\u0153' to 0xBD, + '\u0178' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u00C3' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u00CC' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u00D0' to 0xD0, + '\u00D1' to 0xD1, + '\u00D2' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u00DE' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u00E3' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u00EC' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u00F0' to 0xF0, + '\u00F1' to 0xF1, + '\u00F2' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u00FE' to 0xFE, + '\u00FF' to 0xFF, + ) + } // /** Page 41 [CP1098: Farsi] */ // CP1098(41, TODO()), @@ -153,31 +2665,1087 @@ public enum class Charset( // CP1125(44), /** Page 45 [Windows-1250] */ - Windows1250(45, "windows-1250"), + public data object Windows1250 : Charset(45, "windows-1250") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\uFFFD' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\uFFFD' to 0x88, + '\u2030' to 0x89, + '\u0160' to 0x8A, + '\u2039' to 0x8B, + '\u015A' to 0x8C, + '\u0164' to 0x8D, + '\u017D' to 0x8E, + '\u0179' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\u0161' to 0x9A, + '\u203A' to 0x9B, + '\u015B' to 0x9C, + '\u0165' to 0x9D, + '\u017E' to 0x9E, + '\u017A' to 0x9F, + '\u00A0' to 0xA0, + '\u02C7' to 0xA1, + '\u02D8' to 0xA2, + '\u0141' to 0xA3, + '\u00A4' to 0xA4, + '\u0104' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u015E' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u017B' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u02DB' to 0xB2, + '\u0142' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u0105' to 0xB9, + '\u015F' to 0xBA, + '\u00BB' to 0xBB, + '\u013D' to 0xBC, + '\u02DD' to 0xBD, + '\u013E' to 0xBE, + '\u017C' to 0xBF, + '\u0154' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u0102' to 0xC3, + '\u00C4' to 0xC4, + '\u0139' to 0xC5, + '\u0106' to 0xC6, + '\u00C7' to 0xC7, + '\u010C' to 0xC8, + '\u00C9' to 0xC9, + '\u0118' to 0xCA, + '\u00CB' to 0xCB, + '\u011A' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u010E' to 0xCF, + '\u0110' to 0xD0, + '\u0143' to 0xD1, + '\u0147' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u0150' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u0158' to 0xD8, + '\u016E' to 0xD9, + '\u00DA' to 0xDA, + '\u0170' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u0162' to 0xDE, + '\u00DF' to 0xDF, + '\u0155' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u0103' to 0xE3, + '\u00E4' to 0xE4, + '\u013A' to 0xE5, + '\u0107' to 0xE6, + '\u00E7' to 0xE7, + '\u010D' to 0xE8, + '\u00E9' to 0xE9, + '\u0119' to 0xEA, + '\u00EB' to 0xEB, + '\u011B' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u010F' to 0xEF, + '\u0111' to 0xF0, + '\u0144' to 0xF1, + '\u0148' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u0151' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u0159' to 0xF8, + '\u016F' to 0xF9, + '\u00FA' to 0xFA, + '\u0171' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u0163' to 0xFE, + '\u02D9' to 0xFF, + ) + } /** Page 46 [Windows-1251] */ - Windows1251(46, "windows-1251"), + public data object Windows1251 : Charset(46, "windows-1251") { + override val mapping: Map = + mapOf( + '\u0402' to 0x80, + '\u0403' to 0x81, + '\u201A' to 0x82, + '\u0453' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u20AC' to 0x88, + '\u2030' to 0x89, + '\u0409' to 0x8A, + '\u2039' to 0x8B, + '\u040A' to 0x8C, + '\u040C' to 0x8D, + '\u040B' to 0x8E, + '\u040F' to 0x8F, + '\u0452' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\u0459' to 0x9A, + '\u203A' to 0x9B, + '\u045A' to 0x9C, + '\u045C' to 0x9D, + '\u045B' to 0x9E, + '\u045F' to 0x9F, + '\u00A0' to 0xA0, + '\u040E' to 0xA1, + '\u045E' to 0xA2, + '\u0408' to 0xA3, + '\u00A4' to 0xA4, + '\u0490' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u0401' to 0xA8, + '\u00A9' to 0xA9, + '\u0404' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u0407' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u0406' to 0xB2, + '\u0456' to 0xB3, + '\u0491' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u0451' to 0xB8, + '\u2116' to 0xB9, + '\u0454' to 0xBA, + '\u00BB' to 0xBB, + '\u0458' to 0xBC, + '\u0405' to 0xBD, + '\u0455' to 0xBE, + '\u0457' to 0xBF, + '\u0410' to 0xC0, + '\u0411' to 0xC1, + '\u0412' to 0xC2, + '\u0413' to 0xC3, + '\u0414' to 0xC4, + '\u0415' to 0xC5, + '\u0416' to 0xC6, + '\u0417' to 0xC7, + '\u0418' to 0xC8, + '\u0419' to 0xC9, + '\u041A' to 0xCA, + '\u041B' to 0xCB, + '\u041C' to 0xCC, + '\u041D' to 0xCD, + '\u041E' to 0xCE, + '\u041F' to 0xCF, + '\u0420' to 0xD0, + '\u0421' to 0xD1, + '\u0422' to 0xD2, + '\u0423' to 0xD3, + '\u0424' to 0xD4, + '\u0425' to 0xD5, + '\u0426' to 0xD6, + '\u0427' to 0xD7, + '\u0428' to 0xD8, + '\u0429' to 0xD9, + '\u042A' to 0xDA, + '\u042B' to 0xDB, + '\u042C' to 0xDC, + '\u042D' to 0xDD, + '\u042E' to 0xDE, + '\u042F' to 0xDF, + '\u0430' to 0xE0, + '\u0431' to 0xE1, + '\u0432' to 0xE2, + '\u0433' to 0xE3, + '\u0434' to 0xE4, + '\u0435' to 0xE5, + '\u0436' to 0xE6, + '\u0437' to 0xE7, + '\u0438' to 0xE8, + '\u0439' to 0xE9, + '\u043A' to 0xEA, + '\u043B' to 0xEB, + '\u043C' to 0xEC, + '\u043D' to 0xED, + '\u043E' to 0xEE, + '\u043F' to 0xEF, + '\u0440' to 0xF0, + '\u0441' to 0xF1, + '\u0442' to 0xF2, + '\u0443' to 0xF3, + '\u0444' to 0xF4, + '\u0445' to 0xF5, + '\u0446' to 0xF6, + '\u0447' to 0xF7, + '\u0448' to 0xF8, + '\u0449' to 0xF9, + '\u044A' to 0xFA, + '\u044B' to 0xFB, + '\u044C' to 0xFC, + '\u044D' to 0xFD, + '\u044E' to 0xFE, + '\u044F' to 0xFF, + ) + } /** Page 47 [Windows-1253] */ - Windows1253(47, "windows-1253"), + public data object Windows1253 : Charset(47, "windows-1253") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\uFFFD' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\uFFFD' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\uFFFD' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\u0385' to 0xA1, + '\u0386' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\uFFFD' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u2015' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u0384' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u0388' to 0xB8, + '\u0389' to 0xB9, + '\u038A' to 0xBA, + '\u00BB' to 0xBB, + '\u038C' to 0xBC, + '\u00BD' to 0xBD, + '\u038E' to 0xBE, + '\u038F' to 0xBF, + '\u0390' to 0xC0, + '\u0391' to 0xC1, + '\u0392' to 0xC2, + '\u0393' to 0xC3, + '\u0394' to 0xC4, + '\u0395' to 0xC5, + '\u0396' to 0xC6, + '\u0397' to 0xC7, + '\u0398' to 0xC8, + '\u0399' to 0xC9, + '\u039A' to 0xCA, + '\u039B' to 0xCB, + '\u039C' to 0xCC, + '\u039D' to 0xCD, + '\u039E' to 0xCE, + '\u039F' to 0xCF, + '\u03A0' to 0xD0, + '\u03A1' to 0xD1, + '\uFFFD' to 0xD2, + '\u03A3' to 0xD3, + '\u03A4' to 0xD4, + '\u03A5' to 0xD5, + '\u03A6' to 0xD6, + '\u03A7' to 0xD7, + '\u03A8' to 0xD8, + '\u03A9' to 0xD9, + '\u03AA' to 0xDA, + '\u03AB' to 0xDB, + '\u03AC' to 0xDC, + '\u03AD' to 0xDD, + '\u03AE' to 0xDE, + '\u03AF' to 0xDF, + '\u03B0' to 0xE0, + '\u03B1' to 0xE1, + '\u03B2' to 0xE2, + '\u03B3' to 0xE3, + '\u03B4' to 0xE4, + '\u03B5' to 0xE5, + '\u03B6' to 0xE6, + '\u03B7' to 0xE7, + '\u03B8' to 0xE8, + '\u03B9' to 0xE9, + '\u03BA' to 0xEA, + '\u03BB' to 0xEB, + '\u03BC' to 0xEC, + '\u03BD' to 0xED, + '\u03BE' to 0xEE, + '\u03BF' to 0xEF, + '\u03C0' to 0xF0, + '\u03C1' to 0xF1, + '\u03C2' to 0xF2, + '\u03C3' to 0xF3, + '\u03C4' to 0xF4, + '\u03C5' to 0xF5, + '\u03C6' to 0xF6, + '\u03C7' to 0xF7, + '\u03C8' to 0xF8, + '\u03C9' to 0xF9, + '\u03CA' to 0xFA, + '\u03CB' to 0xFB, + '\u03CC' to 0xFC, + '\u03CD' to 0xFD, + '\u03CE' to 0xFE, + '\uFFFD' to 0xFF, + ) + } /** Page 48 [Windows-1254] */ - Windows1254(48, "windows-1254"), + public data object Windows1254 : Charset(48, "windows-1254") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\u0160' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\u0161' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\u0178' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u00C3' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u00CC' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u011E' to 0xD0, + '\u00D1' to 0xD1, + '\u00D2' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u0130' to 0xDD, + '\u015E' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u00E3' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u00EC' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u011F' to 0xF0, + '\u00F1' to 0xF1, + '\u00F2' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u0131' to 0xFD, + '\u015F' to 0xFE, + '\u00FF' to 0xFF, + ) + } /** Page 49 [Windows-1255] */ - Windows1255(49, "windows-1255"), + public data object Windows1255 : Charset(49, "windows-1255") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\uFFFD' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\uFFFD' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u20AA' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00D7' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00F7' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u05B0' to 0xC0, + '\u05B1' to 0xC1, + '\u05B2' to 0xC2, + '\u05B3' to 0xC3, + '\u05B4' to 0xC4, + '\u05B5' to 0xC5, + '\u05B6' to 0xC6, + '\u05B7' to 0xC7, + '\u05B8' to 0xC8, + '\u05B9' to 0xC9, + '\uFFFD' to 0xCA, + '\u05BB' to 0xCB, + '\u05BC' to 0xCC, + '\u05BD' to 0xCD, + '\u05BE' to 0xCE, + '\u05BF' to 0xCF, + '\u05C0' to 0xD0, + '\u05C1' to 0xD1, + '\u05C2' to 0xD2, + '\u05C3' to 0xD3, + '\u05F0' to 0xD4, + '\u05F1' to 0xD5, + '\u05F2' to 0xD6, + '\u05F3' to 0xD7, + '\u05F4' to 0xD8, + '\uFFFD' to 0xD9, + '\uFFFD' to 0xDA, + '\uFFFD' to 0xDB, + '\uFFFD' to 0xDC, + '\uFFFD' to 0xDD, + '\uFFFD' to 0xDE, + '\uFFFD' to 0xDF, + '\u05D0' to 0xE0, + '\u05D1' to 0xE1, + '\u05D2' to 0xE2, + '\u05D3' to 0xE3, + '\u05D4' to 0xE4, + '\u05D5' to 0xE5, + '\u05D6' to 0xE6, + '\u05D7' to 0xE7, + '\u05D8' to 0xE8, + '\u05D9' to 0xE9, + '\u05DA' to 0xEA, + '\u05DB' to 0xEB, + '\u05DC' to 0xEC, + '\u05DD' to 0xED, + '\u05DE' to 0xEE, + '\u05DF' to 0xEF, + '\u05E0' to 0xF0, + '\u05E1' to 0xF1, + '\u05E2' to 0xF2, + '\u05E3' to 0xF3, + '\u05E4' to 0xF4, + '\u05E5' to 0xF5, + '\u05E6' to 0xF6, + '\u05E7' to 0xF7, + '\u05E8' to 0xF8, + '\u05E9' to 0xF9, + '\u05EA' to 0xFA, + '\uFFFD' to 0xFB, + '\uFFFD' to 0xFC, + '\u200E' to 0xFD, + '\u200F' to 0xFE, + '\uFFFD' to 0xFF, + ) + } /** Page 50 [Windows-1256] */ - Windows1256(50, "windows-1256"), + public data object Windows1256 : Charset(50, "windows-1256") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\u067E' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\u0679' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\u0686' to 0x8D, + '\u0698' to 0x8E, + '\u0688' to 0x8F, + '\u06AF' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u06A9' to 0x98, + '\u2122' to 0x99, + '\u0691' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\u200C' to 0x9D, + '\u200D' to 0x9E, + '\u06BA' to 0x9F, + '\u00A0' to 0xA0, + '\u060C' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u06BE' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u061B' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u061F' to 0xBF, + '\u06C1' to 0xC0, + '\u0621' to 0xC1, + '\u0622' to 0xC2, + '\u0623' to 0xC3, + '\u0624' to 0xC4, + '\u0625' to 0xC5, + '\u0626' to 0xC6, + '\u0627' to 0xC7, + '\u0628' to 0xC8, + '\u0629' to 0xC9, + '\u062A' to 0xCA, + '\u062B' to 0xCB, + '\u062C' to 0xCC, + '\u062D' to 0xCD, + '\u062E' to 0xCE, + '\u062F' to 0xCF, + '\u0630' to 0xD0, + '\u0631' to 0xD1, + '\u0632' to 0xD2, + '\u0633' to 0xD3, + '\u0634' to 0xD4, + '\u0635' to 0xD5, + '\u0636' to 0xD6, + '\u00D7' to 0xD7, + '\u0637' to 0xD8, + '\u0638' to 0xD9, + '\u0639' to 0xDA, + '\u063A' to 0xDB, + '\u0640' to 0xDC, + '\u0641' to 0xDD, + '\u0642' to 0xDE, + '\u0643' to 0xDF, + '\u00E0' to 0xE0, + '\u0644' to 0xE1, + '\u00E2' to 0xE2, + '\u0645' to 0xE3, + '\u0646' to 0xE4, + '\u0647' to 0xE5, + '\u0648' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u0649' to 0xEC, + '\u064A' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u064B' to 0xF0, + '\u064C' to 0xF1, + '\u064D' to 0xF2, + '\u064E' to 0xF3, + '\u00F4' to 0xF4, + '\u064F' to 0xF5, + '\u0650' to 0xF6, + '\u00F7' to 0xF7, + '\u0651' to 0xF8, + '\u00F9' to 0xF9, + '\u0652' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u200E' to 0xFD, + '\u200F' to 0xFE, + '\u06D2' to 0xFF, + ) + } /** Page 51 [Windows-1257] */ - Windows1257(51, "windows-1257"), + public data object Windows1257 : Charset(51, "windows-1257") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\uFFFD' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\uFFFD' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\uFFFD' to 0x8C, + '\u00A8' to 0x8D, + '\u02C7' to 0x8E, + '\u00B8' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\uFFFD' to 0x9C, + '\u00AF' to 0x9D, + '\u02DB' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\uFFFD' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\uFFFD' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00D8' to 0xA8, + '\u00A9' to 0xA9, + '\u0156' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00C6' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00F8' to 0xB8, + '\u00B9' to 0xB9, + '\u0157' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00E6' to 0xBF, + '\u0104' to 0xC0, + '\u012E' to 0xC1, + '\u0100' to 0xC2, + '\u0106' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u0118' to 0xC6, + '\u0112' to 0xC7, + '\u010C' to 0xC8, + '\u00C9' to 0xC9, + '\u0179' to 0xCA, + '\u0116' to 0xCB, + '\u0122' to 0xCC, + '\u0136' to 0xCD, + '\u012A' to 0xCE, + '\u013B' to 0xCF, + '\u0160' to 0xD0, + '\u0143' to 0xD1, + '\u0145' to 0xD2, + '\u00D3' to 0xD3, + '\u014C' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u0172' to 0xD8, + '\u0141' to 0xD9, + '\u015A' to 0xDA, + '\u016A' to 0xDB, + '\u00DC' to 0xDC, + '\u017B' to 0xDD, + '\u017D' to 0xDE, + '\u00DF' to 0xDF, + '\u0105' to 0xE0, + '\u012F' to 0xE1, + '\u0101' to 0xE2, + '\u0107' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u0119' to 0xE6, + '\u0113' to 0xE7, + '\u010D' to 0xE8, + '\u00E9' to 0xE9, + '\u017A' to 0xEA, + '\u0117' to 0xEB, + '\u0123' to 0xEC, + '\u0137' to 0xED, + '\u012B' to 0xEE, + '\u013C' to 0xEF, + '\u0161' to 0xF0, + '\u0144' to 0xF1, + '\u0146' to 0xF2, + '\u00F3' to 0xF3, + '\u014D' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u0173' to 0xF8, + '\u0142' to 0xF9, + '\u015B' to 0xFA, + '\u016B' to 0xFB, + '\u00FC' to 0xFC, + '\u017C' to 0xFD, + '\u017E' to 0xFE, + '\u02D9' to 0xFF, + ) + } /** Page 52 [Windows-1258] */ - Windows1258(52, "windows-1258"), + public data object Windows1258 : Charset(52, "windows-1258") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\u0178' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u0102' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u0300' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u0110' to 0xD0, + '\u00D1' to 0xD1, + '\u0309' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u01A0' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u01AF' to 0xDD, + '\u0303' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u0103' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u0301' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u0111' to 0xF0, + '\u00F1' to 0xF1, + '\u0323' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u01A1' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u01B0' to 0xFD, + '\u20AB' to 0xFE, + '\u00FF' to 0xFF, + ) + } - /** Page 53 [KZ-1048: Kazakhstan] */ - KZ1048(52, "KZ-1048"); + // /** Page 53 [KZ-1048: Kazakhstan] */ + // KZ1048(52, "KZ-1048"); // /** Page 66 [Devanagari] */ // Devanagari(66), @@ -211,11 +3779,4 @@ public enum class Charset( // // /** Page 82 [Marathi] */ // Marathi(82) - - // TODO - // public fun encode(text: String): ByteArray = encode(text, this) - - public companion object { - internal val default = entries.first() - } } diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt index ed84ac9..72f7319 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt @@ -20,7 +20,7 @@ internal sealed class Command { abstract fun bytes(): ByteArray class Text(private val text: String, charset: Charset) : Command() { - private val encodedBytes: ByteArray by lazy { encode(text, charset) } + private val encodedBytes: ByteArray by lazy { text.encode(charset) } override fun bytes(): ByteArray = encodedBytes.copyOf() diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt index f536975..e192ab0 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt @@ -17,3 +17,47 @@ package cz.multiplatform.escpos4k.core internal expect fun encode(text: String, charset: Charset): ByteArray + +private const val replacement = '?' +private const val replacementByte = replacement.code.toByte() + +internal fun String.encode(charset: Charset): ByteArray { + val output = ByteArray(length) + + for ((index, char) in this.withIndex()) { + val byte: Byte = + when { + // 0..31 are control characters, always replaced + char.code < 32 -> { + log("Replacing control character '${char.code}' at index $index with '$replacement'.") + replacementByte + } + + // Printable ASCII up to 127 + char.code < 128 -> { + char.code.toByte() + } + + // Page-specific characters + else -> { + val byte = charset.mapping[char]?.toByte() + if (byte == null) { + log( + "[${charset.ianaName}] Replacing unmappable code unit '${char.code}' at index $index with '$replacement'") + } + byte ?: replacementByte + } + } + + output[index] = byte + } + + return output +} + +private fun log(msg: String) { + val debug = false + if (debug) { + println(msg) + } +} From 79909bcd88f33ab42528ea036c7f1b526b5860e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 17:43:28 +0200 Subject: [PATCH 02/34] Delete the old expect/actual fun encode --- .../escpos4k/core/Encoder.android.kt | 36 --------- .../escpos4k/core/Encoder.apple.kt | 74 ------------------- .../cz/multiplatform/escpos4k/core/Encoder.kt | 2 - .../escpos4k/core/Encoder.jvm.kt | 36 --------- 4 files changed, 148 deletions(-) delete mode 100644 escpos4k/src/androidMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.android.kt delete mode 100644 escpos4k/src/appleMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.apple.kt delete mode 100644 escpos4k/src/jvmMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.jvm.kt diff --git a/escpos4k/src/androidMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.android.kt b/escpos4k/src/androidMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.android.kt deleted file mode 100644 index 5e4d255..0000000 --- a/escpos4k/src/androidMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.android.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Ondřej Karmazín - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cz.multiplatform.escpos4k.core - -import java.nio.ByteBuffer -import java.nio.CharBuffer -import java.nio.charset.CodingErrorAction -import java.nio.charset.Charset as JavaCharset - -internal actual fun encode(text: String, charset: Charset): ByteArray = - JavaCharset.forName(charset.ianaName) - .newEncoder() - .onMalformedInput(CodingErrorAction.REPLACE) - .onUnmappableCharacter(CodingErrorAction.REPLACE) - .encode(CharBuffer.wrap(text)) - .toByteArray() - -private fun ByteBuffer.toByteArray(): ByteArray { - val array = ByteArray(remaining()) - get(array) - return array -} diff --git a/escpos4k/src/appleMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.apple.kt b/escpos4k/src/appleMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.apple.kt deleted file mode 100644 index fb3e77b..0000000 --- a/escpos4k/src/appleMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.apple.kt +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2023 Ondřej Karmazín - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cz.multiplatform.escpos4k.core - -import cnames.structs.__CFString -import kotlinx.cinterop.CPointer -import kotlinx.cinterop.ExperimentalForeignApi -import kotlinx.cinterop.addressOf -import kotlinx.cinterop.usePinned -import platform.CoreFoundation.CFRelease -import platform.CoreFoundation.CFStringConvertEncodingToNSStringEncoding -import platform.CoreFoundation.CFStringConvertIANACharSetNameToEncoding -import platform.CoreFoundation.CFStringRef -import platform.CoreFoundation.kCFStringEncodingInvalidId -import platform.Foundation.CFBridgingRetain -import platform.Foundation.NSData -import platform.Foundation.NSString -import platform.Foundation.dataUsingEncoding -import platform.posix.memcpy - -@OptIn(ExperimentalForeignApi::class) -internal actual fun encode(text: String, charset: Charset): ByteArray { - var cfCharsetName: CPointer<__CFString>? = null - try { - // (1) Cast a NSString as CFStringRef for the CF lookup function. - // The BridgingRetain function will transfer the ownership to us, - // making us responsible for freeing the memory. - cfCharsetName = CFBridgingRetain(charset.ianaName as NSString) as CFStringRef? - - // (2) Using the prepared CFStringRef, find the CFStringEncoding. - val cfEncoding = CFStringConvertIANACharSetNameToEncoding(cfCharsetName) - if (cfEncoding == kCFStringEncodingInvalidId) { - throw RuntimeException("invalid encoding: ${charset.ianaName}") - } - - // (3) Using the CF encoding, find the corresponding NSStringEncoding - val nsEncoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding) - - // (4) Encode the Kotlin String using the NS Encoding. The resulting NSData is - // lives in the ARC-enabled runtime and since it does not escape the current - // scope, will be collected when scope ends. - val encodedData: NSData = - (text as NSString).dataUsingEncoding(nsEncoding, allowLossyConversion = true) - ?: throw RuntimeException("encoder failed") - val encodedBytes = encodedData.bytes ?: throw RuntimeException("encoder failed") - - // (5) Create a Kotlin-land ByteArray and copy over the encoded bytes - // from the ObjC-land NSData. - // - // https://github.com/JetBrains/kotlin-native/issues/3172 - return ByteArray(encodedData.length.toInt()).apply { - usePinned { pinnedByteArray -> - memcpy(pinnedByteArray.addressOf(0), encodedBytes, encodedData.length) - } - } - } finally { - // Don't forget to free the unmanaged CF pointer! - CFRelease(cfCharsetName) - } -} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt index e192ab0..84caebf 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt @@ -16,8 +16,6 @@ package cz.multiplatform.escpos4k.core -internal expect fun encode(text: String, charset: Charset): ByteArray - private const val replacement = '?' private const val replacementByte = replacement.code.toByte() diff --git a/escpos4k/src/jvmMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.jvm.kt b/escpos4k/src/jvmMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.jvm.kt deleted file mode 100644 index 5e4d255..0000000 --- a/escpos4k/src/jvmMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.jvm.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023 Ondřej Karmazín - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package cz.multiplatform.escpos4k.core - -import java.nio.ByteBuffer -import java.nio.CharBuffer -import java.nio.charset.CodingErrorAction -import java.nio.charset.Charset as JavaCharset - -internal actual fun encode(text: String, charset: Charset): ByteArray = - JavaCharset.forName(charset.ianaName) - .newEncoder() - .onMalformedInput(CodingErrorAction.REPLACE) - .onUnmappableCharacter(CodingErrorAction.REPLACE) - .encode(CharBuffer.wrap(text)) - .toByteArray() - -private fun ByteBuffer.toByteArray(): ByteArray { - val array = ByteArray(remaining()) - get(array) - return array -} From 78789fd5d73ab60879042bfcfac4d4ce71f65a48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:16:29 +0200 Subject: [PATCH 03/34] Move Charset to package encoding.charset --- .../kotlin/cz/multiplatform/escpos4k/core/Command.kt | 2 ++ .../kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt | 1 + .../kotlin/cz/multiplatform/escpos4k/core/Encoder.kt | 2 ++ .../escpos4k/core/{ => encoding/charset}/Charset.kt | 4 ++-- .../cz/multiplatform/escpos4k/core/CommandBuilderTest.kt | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/{ => encoding/charset}/Charset.kt (99%) diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt index 72f7319..f9b5ec4 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt @@ -16,6 +16,8 @@ package cz.multiplatform.escpos4k.core +import cz.multiplatform.escpos4k.core.encoding.charset.Charset + internal sealed class Command { abstract fun bytes(): ByteArray diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt index 18b5e63..019c832 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt @@ -20,6 +20,7 @@ import arrow.core.Nel import arrow.core.nonEmptyListOf import arrow.core.toNonEmptyListOrNull import cz.multiplatform.escpos4k.core.LineDistributionStrategy.Companion.SpaceEvenly +import cz.multiplatform.escpos4k.core.encoding.charset.Charset /** * The central class for building the content to send to the printer. The class provides a variety diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt index 84caebf..238cbda 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt @@ -16,6 +16,8 @@ package cz.multiplatform.escpos4k.core +import cz.multiplatform.escpos4k.core.encoding.charset.Charset + private const val replacement = '?' private const val replacementByte = replacement.code.toByte() diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt similarity index 99% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index a9af839..2487587 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 Ondřej Karmazín + * Copyright 2024 Ondřej Karmazín * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package cz.multiplatform.escpos4k.core +package cz.multiplatform.escpos4k.core.encoding.charset public sealed class Charset( /** diff --git a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt index 2b1c341..0fab1b2 100644 --- a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt +++ b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt @@ -1,5 +1,6 @@ package cz.multiplatform.escpos4k.core +import cz.multiplatform.escpos4k.core.encoding.charset.Charset import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly From 65d5f8c4f4c22ece7f265a97770241e9312db35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:17:25 +0200 Subject: [PATCH 04/34] Move Encoder.kt to package encoding --- .../kotlin/cz/multiplatform/escpos4k/core/Command.kt | 1 + .../cz/multiplatform/escpos4k/core/{ => encoding}/Encoder.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/{ => encoding}/Encoder.kt (95%) diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt index f9b5ec4..070bceb 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Command.kt @@ -17,6 +17,7 @@ package cz.multiplatform.escpos4k.core import cz.multiplatform.escpos4k.core.encoding.charset.Charset +import cz.multiplatform.escpos4k.core.encoding.encode internal sealed class Command { abstract fun bytes(): ByteArray diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/Encoder.kt similarity index 95% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/Encoder.kt index 238cbda..b355d05 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/Encoder.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/Encoder.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 Ondřej Karmazín + * Copyright 2024 Ondřej Karmazín * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package cz.multiplatform.escpos4k.core +package cz.multiplatform.escpos4k.core.encoding import cz.multiplatform.escpos4k.core.encoding.charset.Charset From 44187547d072f1102b9292de98f9133d3688ba19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:22:01 +0200 Subject: [PATCH 05/34] Extract CP437 to its own file --- .../escpos4k/core/encoding/charset/CP437.kt | 151 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 134 ---------------- 2 files changed, 151 insertions(+), 134 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt new file mode 100644 index 0000000..760c361 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt @@ -0,0 +1,151 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 0 [CP437: USA, Standard Europe] */ +public data object CP437 : Charset(0, "IBM437") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00A5' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 2487587..f405ecf 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -37,140 +37,6 @@ public sealed class Charset( internal abstract val mapping: Map - /** Page 0 [CP437: USA, Standard Europe] */ - public data object CP437 : Charset(0, "IBM437") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u00E0' to 0x85, - '\u00E5' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00EF' to 0x8B, - '\u00EE' to 0x8C, - '\u00EC' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u00F2' to 0x95, - '\u00FB' to 0x96, - '\u00F9' to 0x97, - '\u00FF' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00A2' to 0x9B, - '\u00A3' to 0x9C, - '\u00A5' to 0x9D, - '\u20A7' to 0x9E, - '\u0192' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u00AA' to 0xA6, - '\u00BA' to 0xA7, - '\u00BF' to 0xA8, - '\u2310' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u03B1' to 0xE0, - '\u00DF' to 0xE1, - '\u0393' to 0xE2, - '\u03C0' to 0xE3, - '\u03A3' to 0xE4, - '\u03C3' to 0xE5, - '\u00B5' to 0xE6, - '\u03C4' to 0xE7, - '\u03A6' to 0xE8, - '\u0398' to 0xE9, - '\u03A9' to 0xEA, - '\u03B4' to 0xEB, - '\u221E' to 0xEC, - '\u03C6' to 0xED, - '\u03B5' to 0xEE, - '\u2229' to 0xEF, - '\u2261' to 0xF0, - '\u00B1' to 0xF1, - '\u2265' to 0xF2, - '\u2264' to 0xF3, - '\u2320' to 0xF4, - '\u2321' to 0xF5, - '\u00F7' to 0xF6, - '\u2248' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u207F' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF) - } - // /** Page 1 [Katakana] */ // Katakana(1, TODO()), From cacc0802ba9a7e52708f2be0d3f83cc32d54b5db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:23:26 +0200 Subject: [PATCH 06/34] Extract CP850 to its own file --- .../escpos4k/core/encoding/charset/CP850.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../escpos4k/core/CommandBuilderTest.kt | 17 +- 3 files changed, 160 insertions(+), 144 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt new file mode 100644 index 0000000..8dbee68 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 2 [CP850: Multilingual] */ +public data object CP850 : Charset(2, "IBM850") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u00D7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u00C0' to 0xB7, + '\u00A9' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u00A2' to 0xBD, + '\u00A5' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u00E3' to 0xC6, + '\u00C3' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u00F0' to 0xD0, + '\u00D0' to 0xD1, + '\u00CA' to 0xD2, + '\u00CB' to 0xD3, + '\u00C8' to 0xD4, + '\u0131' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u00CF' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u00A6' to 0xDD, + '\u00CC' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u00D2' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\u00FE' to 0xE7, + '\u00DE' to 0xE8, + '\u00DA' to 0xE9, + '\u00DB' to 0xEA, + '\u00D9' to 0xEB, + '\u00FD' to 0xEC, + '\u00DD' to 0xED, + '\u00AF' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u2017' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index f405ecf..e00416b 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -40,141 +40,6 @@ public sealed class Charset( // /** Page 1 [Katakana] */ // Katakana(1, TODO()), - /** Page 2 [CP850: Multilingual] */ - public data object CP850 : Charset(2, "IBM850") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u00E0' to 0x85, - '\u00E5' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00EF' to 0x8B, - '\u00EE' to 0x8C, - '\u00EC' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u00F2' to 0x95, - '\u00FB' to 0x96, - '\u00F9' to 0x97, - '\u00FF' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00F8' to 0x9B, - '\u00A3' to 0x9C, - '\u00D8' to 0x9D, - '\u00D7' to 0x9E, - '\u0192' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u00AA' to 0xA6, - '\u00BA' to 0xA7, - '\u00BF' to 0xA8, - '\u00AE' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u00C1' to 0xB5, - '\u00C2' to 0xB6, - '\u00C0' to 0xB7, - '\u00A9' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u00A2' to 0xBD, - '\u00A5' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u00E3' to 0xC6, - '\u00C3' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u00A4' to 0xCF, - '\u00F0' to 0xD0, - '\u00D0' to 0xD1, - '\u00CA' to 0xD2, - '\u00CB' to 0xD3, - '\u00C8' to 0xD4, - '\u0131' to 0xD5, - '\u00CD' to 0xD6, - '\u00CE' to 0xD7, - '\u00CF' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u00A6' to 0xDD, - '\u00CC' to 0xDE, - '\u2580' to 0xDF, - '\u00D3' to 0xE0, - '\u00DF' to 0xE1, - '\u00D4' to 0xE2, - '\u00D2' to 0xE3, - '\u00F5' to 0xE4, - '\u00D5' to 0xE5, - '\u00B5' to 0xE6, - '\u00FE' to 0xE7, - '\u00DE' to 0xE8, - '\u00DA' to 0xE9, - '\u00DB' to 0xEA, - '\u00D9' to 0xEB, - '\u00FD' to 0xEC, - '\u00DD' to 0xED, - '\u00AF' to 0xEE, - '\u00B4' to 0xEF, - '\u00AD' to 0xF0, - '\u00B1' to 0xF1, - '\u2017' to 0xF2, - '\u00BE' to 0xF3, - '\u00B6' to 0xF4, - '\u00A7' to 0xF5, - '\u00F7' to 0xF6, - '\u00B8' to 0xF7, - '\u00B0' to 0xF8, - '\u00A8' to 0xF9, - '\u00B7' to 0xFA, - '\u00B9' to 0xFB, - '\u00B3' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 3 [CP860: Portuguese] */ public data object CP860 : Charset(3, "IBM860") { override val mapping: Map = diff --git a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt index 0fab1b2..6f585fd 100644 --- a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt +++ b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt @@ -1,5 +1,6 @@ package cz.multiplatform.escpos4k.core +import cz.multiplatform.escpos4k.core.encoding.charset.CP850 import cz.multiplatform.escpos4k.core.encoding.charset.Charset import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly @@ -33,14 +34,12 @@ class CommandBuilderTest : FunSpec() { val builder = CommandBuilder(defaultConfig) { charset(Charset.default) - charset(Charset.CP850) - charset(Charset.CP850) + charset(CP850) + charset(CP850) charset(Charset.Windows1251) } builder.commands shouldContainExactly - initSequence + - Command.SelectCharset(Charset.CP850) + - Command.SelectCharset(Charset.Windows1251) + initSequence + Command.SelectCharset(CP850) + Command.SelectCharset(Charset.Windows1251) } } @@ -49,8 +48,8 @@ class CommandBuilderTest : FunSpec() { val builder = CommandBuilder(defaultConfig) { withCharset(Charset.default) { - withCharset(Charset.CP850) { - withCharset(Charset.CP850) { + withCharset(CP850) { + withCharset(CP850) { withCharset(Charset.Windows1251) { text("innermost") // } @@ -61,10 +60,10 @@ class CommandBuilderTest : FunSpec() { builder.commands shouldContainExactly initSequence + - Command.SelectCharset(Charset.CP850) + + Command.SelectCharset(CP850) + Command.SelectCharset(Charset.Windows1251) + Command.Text("innermost", Charset.Windows1251) + - Command.SelectCharset(Charset.CP850) + + Command.SelectCharset(CP850) + Command.SelectCharset(Charset.default) } } From 5ecd9cc7f8c31ad1fa11758063620dd8126c9633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:24:25 +0200 Subject: [PATCH 07/34] Rename CP437 to IBM437 --- .../cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt | 2 +- .../escpos4k/core/encoding/charset/{CP437.kt => IBM437.kt} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP437.kt => IBM437.kt} (98%) diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index e00416b..f38a96f 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -32,7 +32,7 @@ public sealed class Charset( public val ianaName: String ) { public companion object { - internal val default = CP437 + internal val default = IBM437 } internal abstract val mapping: Map diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM437.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM437.kt index 760c361..cf9905b 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP437.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM437.kt @@ -17,7 +17,7 @@ package cz.multiplatform.escpos4k.core.encoding.charset /** Page 0 [CP437: USA, Standard Europe] */ -public data object CP437 : Charset(0, "IBM437") { +public data object IBM437 : Charset(0, "IBM437") { override val mapping: Map = mapOf( '\u00C7' to 0x80, From f52916b7b0093ceaacbf2fe9b6baf8c0bd514784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:25:32 +0200 Subject: [PATCH 08/34] Rename CP850 to IBM850 --- .../encoding/charset/{CP850.kt => IBM850.kt} | 2 +- .../escpos4k/core/CommandBuilderTest.kt | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP850.kt => IBM850.kt} (98%) diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM850.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM850.kt index 8dbee68..9f915bf 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP850.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM850.kt @@ -17,7 +17,7 @@ package cz.multiplatform.escpos4k.core.encoding.charset /** Page 2 [CP850: Multilingual] */ -public data object CP850 : Charset(2, "IBM850") { +public data object IBM850 : Charset(2, "IBM850") { override val mapping: Map = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt index 6f585fd..0d4593b 100644 --- a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt +++ b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt @@ -1,7 +1,7 @@ package cz.multiplatform.escpos4k.core -import cz.multiplatform.escpos4k.core.encoding.charset.CP850 import cz.multiplatform.escpos4k.core.encoding.charset.Charset +import cz.multiplatform.escpos4k.core.encoding.charset.IBM850 import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly @@ -34,12 +34,12 @@ class CommandBuilderTest : FunSpec() { val builder = CommandBuilder(defaultConfig) { charset(Charset.default) - charset(CP850) - charset(CP850) + charset(IBM850) + charset(IBM850) charset(Charset.Windows1251) } builder.commands shouldContainExactly - initSequence + Command.SelectCharset(CP850) + Command.SelectCharset(Charset.Windows1251) + initSequence + Command.SelectCharset(IBM850) + Command.SelectCharset(Charset.Windows1251) } } @@ -48,8 +48,8 @@ class CommandBuilderTest : FunSpec() { val builder = CommandBuilder(defaultConfig) { withCharset(Charset.default) { - withCharset(CP850) { - withCharset(CP850) { + withCharset(IBM850) { + withCharset(IBM850) { withCharset(Charset.Windows1251) { text("innermost") // } @@ -60,10 +60,10 @@ class CommandBuilderTest : FunSpec() { builder.commands shouldContainExactly initSequence + - Command.SelectCharset(CP850) + + Command.SelectCharset(IBM850) + Command.SelectCharset(Charset.Windows1251) + Command.Text("innermost", Charset.Windows1251) + - Command.SelectCharset(CP850) + + Command.SelectCharset(IBM850) + Command.SelectCharset(Charset.default) } } From d955445cf02192df07416956d4cdc361eab443e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:27:24 +0200 Subject: [PATCH 09/34] Extract CP860 to its own file --- .../escpos4k/core/encoding/charset/CP860.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt new file mode 100644 index 0000000..35f9fab --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 3 [CP860: Portuguese] */ +public data object CP860 : Charset(3, "IBM860") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E3' to 0x84, + '\u00E0' to 0x85, + '\u00C1' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00CA' to 0x89, + '\u00E8' to 0x8A, + '\u00CD' to 0x8B, + '\u00D4' to 0x8C, + '\u00EC' to 0x8D, + '\u00C3' to 0x8E, + '\u00C2' to 0x8F, + '\u00C9' to 0x90, + '\u00C0' to 0x91, + '\u00C8' to 0x92, + '\u00F4' to 0x93, + '\u00F5' to 0x94, + '\u00F2' to 0x95, + '\u00DA' to 0x96, + '\u00F9' to 0x97, + '\u00CC' to 0x98, + '\u00D5' to 0x99, + '\u00DC' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00D9' to 0x9D, + '\u20A7' to 0x9E, + '\u00D3' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u00D2' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index f38a96f..a7461cf 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -40,141 +40,6 @@ public sealed class Charset( // /** Page 1 [Katakana] */ // Katakana(1, TODO()), - /** Page 3 [CP860: Portuguese] */ - public data object CP860 : Charset(3, "IBM860") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E3' to 0x84, - '\u00E0' to 0x85, - '\u00C1' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00CA' to 0x89, - '\u00E8' to 0x8A, - '\u00CD' to 0x8B, - '\u00D4' to 0x8C, - '\u00EC' to 0x8D, - '\u00C3' to 0x8E, - '\u00C2' to 0x8F, - '\u00C9' to 0x90, - '\u00C0' to 0x91, - '\u00C8' to 0x92, - '\u00F4' to 0x93, - '\u00F5' to 0x94, - '\u00F2' to 0x95, - '\u00DA' to 0x96, - '\u00F9' to 0x97, - '\u00CC' to 0x98, - '\u00D5' to 0x99, - '\u00DC' to 0x9A, - '\u00A2' to 0x9B, - '\u00A3' to 0x9C, - '\u00D9' to 0x9D, - '\u20A7' to 0x9E, - '\u00D3' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u00AA' to 0xA6, - '\u00BA' to 0xA7, - '\u00BF' to 0xA8, - '\u00D2' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u03B1' to 0xE0, - '\u00DF' to 0xE1, - '\u0393' to 0xE2, - '\u03C0' to 0xE3, - '\u03A3' to 0xE4, - '\u03C3' to 0xE5, - '\u00B5' to 0xE6, - '\u03C4' to 0xE7, - '\u03A6' to 0xE8, - '\u0398' to 0xE9, - '\u03A9' to 0xEA, - '\u03B4' to 0xEB, - '\u221E' to 0xEC, - '\u03C6' to 0xED, - '\u03B5' to 0xEE, - '\u2229' to 0xEF, - '\u2261' to 0xF0, - '\u00B1' to 0xF1, - '\u2265' to 0xF2, - '\u2264' to 0xF3, - '\u2320' to 0xF4, - '\u2321' to 0xF5, - '\u00F7' to 0xF6, - '\u2248' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u207F' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 4 [CP863: Canadian-French] */ public data object CP863 : Charset(4, "IBM863") { override val mapping: Map = From d9e1359b8bd40ef6b97efca07a973984a696067d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:29:02 +0200 Subject: [PATCH 10/34] Extract CP863 to its own file --- .../escpos4k/core/encoding/charset/CP863.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt new file mode 100644 index 0000000..4a39360 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 4 [CP863: Canadian-French] */ +public data object CP863 : Charset(4, "IBM863") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00C2' to 0x84, + '\u00E0' to 0x85, + '\u00B6' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u2017' to 0x8D, + '\u00C0' to 0x8E, + '\u00A7' to 0x8F, + '\u00C9' to 0x90, + '\u00C8' to 0x91, + '\u00CA' to 0x92, + '\u00F4' to 0x93, + '\u00CB' to 0x94, + '\u00CF' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00A4' to 0x98, + '\u00D4' to 0x99, + '\u00DC' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00D9' to 0x9D, + '\u00DB' to 0x9E, + '\u0192' to 0x9F, + '\u00A6' to 0xA0, + '\u00B4' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00A8' to 0xA4, + '\u00B8' to 0xA5, + '\u00B3' to 0xA6, + '\u00AF' to 0xA7, + '\u00CE' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00BE' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index a7461cf..8ae3488 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -40,141 +40,6 @@ public sealed class Charset( // /** Page 1 [Katakana] */ // Katakana(1, TODO()), - /** Page 4 [CP863: Canadian-French] */ - public data object CP863 : Charset(4, "IBM863") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00C2' to 0x84, - '\u00E0' to 0x85, - '\u00B6' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00EF' to 0x8B, - '\u00EE' to 0x8C, - '\u2017' to 0x8D, - '\u00C0' to 0x8E, - '\u00A7' to 0x8F, - '\u00C9' to 0x90, - '\u00C8' to 0x91, - '\u00CA' to 0x92, - '\u00F4' to 0x93, - '\u00CB' to 0x94, - '\u00CF' to 0x95, - '\u00FB' to 0x96, - '\u00F9' to 0x97, - '\u00A4' to 0x98, - '\u00D4' to 0x99, - '\u00DC' to 0x9A, - '\u00A2' to 0x9B, - '\u00A3' to 0x9C, - '\u00D9' to 0x9D, - '\u00DB' to 0x9E, - '\u0192' to 0x9F, - '\u00A6' to 0xA0, - '\u00B4' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00A8' to 0xA4, - '\u00B8' to 0xA5, - '\u00B3' to 0xA6, - '\u00AF' to 0xA7, - '\u00CE' to 0xA8, - '\u2310' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00BE' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u03B1' to 0xE0, - '\u00DF' to 0xE1, - '\u0393' to 0xE2, - '\u03C0' to 0xE3, - '\u03A3' to 0xE4, - '\u03C3' to 0xE5, - '\u00B5' to 0xE6, - '\u03C4' to 0xE7, - '\u03A6' to 0xE8, - '\u0398' to 0xE9, - '\u03A9' to 0xEA, - '\u03B4' to 0xEB, - '\u221E' to 0xEC, - '\u03C6' to 0xED, - '\u03B5' to 0xEE, - '\u2229' to 0xEF, - '\u2261' to 0xF0, - '\u00B1' to 0xF1, - '\u2265' to 0xF2, - '\u2264' to 0xF3, - '\u2320' to 0xF4, - '\u2321' to 0xF5, - '\u00F7' to 0xF6, - '\u2248' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u207F' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 5 [CP865: Nordic] */ public data object CP865 : Charset(5, "IBM865") { override val mapping: Map = From c45222fdfa079313d25e0f4b2352d5e6212e69d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:29:39 +0200 Subject: [PATCH 11/34] Extract CP865 to its own file --- .../escpos4k/core/encoding/charset/CP865.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt new file mode 100644 index 0000000..d00dfd6 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 5 [CP865: Nordic] */ +public data object CP865 : Charset(5, "IBM865") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00A4' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 8ae3488..203b894 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -40,141 +40,6 @@ public sealed class Charset( // /** Page 1 [Katakana] */ // Katakana(1, TODO()), - /** Page 5 [CP865: Nordic] */ - public data object CP865 : Charset(5, "IBM865") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u00E0' to 0x85, - '\u00E5' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00EF' to 0x8B, - '\u00EE' to 0x8C, - '\u00EC' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u00F2' to 0x95, - '\u00FB' to 0x96, - '\u00F9' to 0x97, - '\u00FF' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00F8' to 0x9B, - '\u00A3' to 0x9C, - '\u00D8' to 0x9D, - '\u20A7' to 0x9E, - '\u0192' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u00AA' to 0xA6, - '\u00BA' to 0xA7, - '\u00BF' to 0xA8, - '\u2310' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00A4' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u03B1' to 0xE0, - '\u00DF' to 0xE1, - '\u0393' to 0xE2, - '\u03C0' to 0xE3, - '\u03A3' to 0xE4, - '\u03C3' to 0xE5, - '\u00B5' to 0xE6, - '\u03C4' to 0xE7, - '\u03A6' to 0xE8, - '\u0398' to 0xE9, - '\u03A9' to 0xEA, - '\u03B4' to 0xEB, - '\u221E' to 0xEC, - '\u03C6' to 0xED, - '\u03B5' to 0xEE, - '\u2229' to 0xEF, - '\u2261' to 0xF0, - '\u00B1' to 0xF1, - '\u2265' to 0xF2, - '\u2264' to 0xF3, - '\u2320' to 0xF4, - '\u2321' to 0xF5, - '\u00F7' to 0xF6, - '\u2248' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u207F' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - // /** Page 6 [Hiragana] */ // Hiragana(6, TODO()), From d687bd5beb8b817240887ada19e876290528f326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:30:19 +0200 Subject: [PATCH 12/34] Extract CP857 to its own file --- .../escpos4k/core/encoding/charset/CP857.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt new file mode 100644 index 0000000..122016f --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 13 [CP857: Turkish] */ +public data object CP857 : Charset(13, "IBM857") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u0131' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u0130' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u015E' to 0x9E, + '\u015F' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u011E' to 0xA6, + '\u011F' to 0xA7, + '\u00BF' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u00C0' to 0xB7, + '\u00A9' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u00A2' to 0xBD, + '\u00A5' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u00E3' to 0xC6, + '\u00C3' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u00BA' to 0xD0, + '\u00AA' to 0xD1, + '\u00CA' to 0xD2, + '\u00CB' to 0xD3, + '\u00C8' to 0xD4, + '\uFFFD' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u00CF' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u00A6' to 0xDD, + '\u00CC' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u00D2' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\uFFFD' to 0xE7, + '\u00D7' to 0xE8, + '\u00DA' to 0xE9, + '\u00DB' to 0xEA, + '\u00D9' to 0xEB, + '\u00EC' to 0xEC, + '\u00FF' to 0xED, + '\u00AF' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\uFFFD' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 203b894..ac94023 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -55,141 +55,6 @@ public sealed class Charset( // /** Page 12 [CP853: Turkish] */ // CP853(12, "IBM853"), - /** Page 13 [CP857: Turkish] */ - public data object CP857 : Charset(13, "IBM857") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u00E0' to 0x85, - '\u00E5' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00EF' to 0x8B, - '\u00EE' to 0x8C, - '\u0131' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u00F2' to 0x95, - '\u00FB' to 0x96, - '\u00F9' to 0x97, - '\u0130' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00F8' to 0x9B, - '\u00A3' to 0x9C, - '\u00D8' to 0x9D, - '\u015E' to 0x9E, - '\u015F' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u011E' to 0xA6, - '\u011F' to 0xA7, - '\u00BF' to 0xA8, - '\u00AE' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u00C1' to 0xB5, - '\u00C2' to 0xB6, - '\u00C0' to 0xB7, - '\u00A9' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u00A2' to 0xBD, - '\u00A5' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u00E3' to 0xC6, - '\u00C3' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u00A4' to 0xCF, - '\u00BA' to 0xD0, - '\u00AA' to 0xD1, - '\u00CA' to 0xD2, - '\u00CB' to 0xD3, - '\u00C8' to 0xD4, - '\uFFFD' to 0xD5, - '\u00CD' to 0xD6, - '\u00CE' to 0xD7, - '\u00CF' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u00A6' to 0xDD, - '\u00CC' to 0xDE, - '\u2580' to 0xDF, - '\u00D3' to 0xE0, - '\u00DF' to 0xE1, - '\u00D4' to 0xE2, - '\u00D2' to 0xE3, - '\u00F5' to 0xE4, - '\u00D5' to 0xE5, - '\u00B5' to 0xE6, - '\uFFFD' to 0xE7, - '\u00D7' to 0xE8, - '\u00DA' to 0xE9, - '\u00DB' to 0xEA, - '\u00D9' to 0xEB, - '\u00EC' to 0xEC, - '\u00FF' to 0xED, - '\u00AF' to 0xEE, - '\u00B4' to 0xEF, - '\u00AD' to 0xF0, - '\u00B1' to 0xF1, - '\uFFFD' to 0xF2, - '\u00BE' to 0xF3, - '\u00B6' to 0xF4, - '\u00A7' to 0xF5, - '\u00F7' to 0xF6, - '\u00B8' to 0xF7, - '\u00B0' to 0xF8, - '\u00A8' to 0xF9, - '\u00B7' to 0xFA, - '\u00B9' to 0xFB, - '\u00B3' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), From 640f33bd1e94b8f14d59299b581fc8db70a6e41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:30:52 +0200 Subject: [PATCH 13/34] Extract ISO_8859_7 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/ISO_8859_7.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_7.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index ac94023..2297a6d 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -58,141 +58,6 @@ public sealed class Charset( // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), - /** Page 15 [ISO8859-7: Greek] */ - public data object ISO_8859_7 : Charset(15, "ISO-8859-7") { - override val mapping: Map = - mapOf( - '\u0080' to 0x80, - '\u0081' to 0x81, - '\u0082' to 0x82, - '\u0083' to 0x83, - '\u0084' to 0x84, - '\u0085' to 0x85, - '\u0086' to 0x86, - '\u0087' to 0x87, - '\u0088' to 0x88, - '\u0089' to 0x89, - '\u008A' to 0x8A, - '\u008B' to 0x8B, - '\u008C' to 0x8C, - '\u008D' to 0x8D, - '\u008E' to 0x8E, - '\u008F' to 0x8F, - '\u0090' to 0x90, - '\u0091' to 0x91, - '\u0092' to 0x92, - '\u0093' to 0x93, - '\u0094' to 0x94, - '\u0095' to 0x95, - '\u0096' to 0x96, - '\u0097' to 0x97, - '\u0098' to 0x98, - '\u0099' to 0x99, - '\u009A' to 0x9A, - '\u009B' to 0x9B, - '\u009C' to 0x9C, - '\u009D' to 0x9D, - '\u009E' to 0x9E, - '\u009F' to 0x9F, - '\u00A0' to 0xA0, - '\u2018' to 0xA1, - '\u2019' to 0xA2, - '\u00A3' to 0xA3, - '\u20AC' to 0xA4, - '\u20AF' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u037A' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\uFFFD' to 0xAE, - '\u2015' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u0384' to 0xB4, - '\u0385' to 0xB5, - '\u0386' to 0xB6, - '\u00B7' to 0xB7, - '\u0388' to 0xB8, - '\u0389' to 0xB9, - '\u038A' to 0xBA, - '\u00BB' to 0xBB, - '\u038C' to 0xBC, - '\u00BD' to 0xBD, - '\u038E' to 0xBE, - '\u038F' to 0xBF, - '\u0390' to 0xC0, - '\u0391' to 0xC1, - '\u0392' to 0xC2, - '\u0393' to 0xC3, - '\u0394' to 0xC4, - '\u0395' to 0xC5, - '\u0396' to 0xC6, - '\u0397' to 0xC7, - '\u0398' to 0xC8, - '\u0399' to 0xC9, - '\u039A' to 0xCA, - '\u039B' to 0xCB, - '\u039C' to 0xCC, - '\u039D' to 0xCD, - '\u039E' to 0xCE, - '\u039F' to 0xCF, - '\u03A0' to 0xD0, - '\u03A1' to 0xD1, - '\uFFFD' to 0xD2, - '\u03A3' to 0xD3, - '\u03A4' to 0xD4, - '\u03A5' to 0xD5, - '\u03A6' to 0xD6, - '\u03A7' to 0xD7, - '\u03A8' to 0xD8, - '\u03A9' to 0xD9, - '\u03AA' to 0xDA, - '\u03AB' to 0xDB, - '\u03AC' to 0xDC, - '\u03AD' to 0xDD, - '\u03AE' to 0xDE, - '\u03AF' to 0xDF, - '\u03B0' to 0xE0, - '\u03B1' to 0xE1, - '\u03B2' to 0xE2, - '\u03B3' to 0xE3, - '\u03B4' to 0xE4, - '\u03B5' to 0xE5, - '\u03B6' to 0xE6, - '\u03B7' to 0xE7, - '\u03B8' to 0xE8, - '\u03B9' to 0xE9, - '\u03BA' to 0xEA, - '\u03BB' to 0xEB, - '\u03BC' to 0xEC, - '\u03BD' to 0xED, - '\u03BE' to 0xEE, - '\u03BF' to 0xEF, - '\u03C0' to 0xF0, - '\u03C1' to 0xF1, - '\u03C2' to 0xF2, - '\u03C3' to 0xF3, - '\u03C4' to 0xF4, - '\u03C5' to 0xF5, - '\u03C6' to 0xF6, - '\u03C7' to 0xF7, - '\u03C8' to 0xF8, - '\u03C9' to 0xF9, - '\u03CA' to 0xFA, - '\u03CB' to 0xFB, - '\u03CC' to 0xFC, - '\u03CD' to 0xFD, - '\u03CE' to 0xFE, - '\uFFFD' to 0xFF, - ) - } - /** Page 16 [Windows-1252] */ public data object Windows1252 : Charset(16, "windows-1252") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_7.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_7.kt new file mode 100644 index 0000000..6928d48 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_7.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 15 [ISO8859-7: Greek] */ +public data object ISO_8859_7 : Charset(15, "ISO-8859-7") { + override val mapping: Map = + mapOf( + '\u0080' to 0x80, + '\u0081' to 0x81, + '\u0082' to 0x82, + '\u0083' to 0x83, + '\u0084' to 0x84, + '\u0085' to 0x85, + '\u0086' to 0x86, + '\u0087' to 0x87, + '\u0088' to 0x88, + '\u0089' to 0x89, + '\u008A' to 0x8A, + '\u008B' to 0x8B, + '\u008C' to 0x8C, + '\u008D' to 0x8D, + '\u008E' to 0x8E, + '\u008F' to 0x8F, + '\u0090' to 0x90, + '\u0091' to 0x91, + '\u0092' to 0x92, + '\u0093' to 0x93, + '\u0094' to 0x94, + '\u0095' to 0x95, + '\u0096' to 0x96, + '\u0097' to 0x97, + '\u0098' to 0x98, + '\u0099' to 0x99, + '\u009A' to 0x9A, + '\u009B' to 0x9B, + '\u009C' to 0x9C, + '\u009D' to 0x9D, + '\u009E' to 0x9E, + '\u009F' to 0x9F, + '\u00A0' to 0xA0, + '\u2018' to 0xA1, + '\u2019' to 0xA2, + '\u00A3' to 0xA3, + '\u20AC' to 0xA4, + '\u20AF' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u037A' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\uFFFD' to 0xAE, + '\u2015' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u0384' to 0xB4, + '\u0385' to 0xB5, + '\u0386' to 0xB6, + '\u00B7' to 0xB7, + '\u0388' to 0xB8, + '\u0389' to 0xB9, + '\u038A' to 0xBA, + '\u00BB' to 0xBB, + '\u038C' to 0xBC, + '\u00BD' to 0xBD, + '\u038E' to 0xBE, + '\u038F' to 0xBF, + '\u0390' to 0xC0, + '\u0391' to 0xC1, + '\u0392' to 0xC2, + '\u0393' to 0xC3, + '\u0394' to 0xC4, + '\u0395' to 0xC5, + '\u0396' to 0xC6, + '\u0397' to 0xC7, + '\u0398' to 0xC8, + '\u0399' to 0xC9, + '\u039A' to 0xCA, + '\u039B' to 0xCB, + '\u039C' to 0xCC, + '\u039D' to 0xCD, + '\u039E' to 0xCE, + '\u039F' to 0xCF, + '\u03A0' to 0xD0, + '\u03A1' to 0xD1, + '\uFFFD' to 0xD2, + '\u03A3' to 0xD3, + '\u03A4' to 0xD4, + '\u03A5' to 0xD5, + '\u03A6' to 0xD6, + '\u03A7' to 0xD7, + '\u03A8' to 0xD8, + '\u03A9' to 0xD9, + '\u03AA' to 0xDA, + '\u03AB' to 0xDB, + '\u03AC' to 0xDC, + '\u03AD' to 0xDD, + '\u03AE' to 0xDE, + '\u03AF' to 0xDF, + '\u03B0' to 0xE0, + '\u03B1' to 0xE1, + '\u03B2' to 0xE2, + '\u03B3' to 0xE3, + '\u03B4' to 0xE4, + '\u03B5' to 0xE5, + '\u03B6' to 0xE6, + '\u03B7' to 0xE7, + '\u03B8' to 0xE8, + '\u03B9' to 0xE9, + '\u03BA' to 0xEA, + '\u03BB' to 0xEB, + '\u03BC' to 0xEC, + '\u03BD' to 0xED, + '\u03BE' to 0xEE, + '\u03BF' to 0xEF, + '\u03C0' to 0xF0, + '\u03C1' to 0xF1, + '\u03C2' to 0xF2, + '\u03C3' to 0xF3, + '\u03C4' to 0xF4, + '\u03C5' to 0xF5, + '\u03C6' to 0xF6, + '\u03C7' to 0xF7, + '\u03C8' to 0xF8, + '\u03C9' to 0xF9, + '\u03CA' to 0xFA, + '\u03CB' to 0xFB, + '\u03CC' to 0xFC, + '\u03CD' to 0xFD, + '\u03CE' to 0xFE, + '\uFFFD' to 0xFF, + ) +} From 924053c0580aa276dc4994eb2485eedcce59c1b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:31:26 +0200 Subject: [PATCH 14/34] Extract Windows1252 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1252.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1252.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 2297a6d..b1ce1a4 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -58,141 +58,6 @@ public sealed class Charset( // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), - /** Page 16 [Windows-1252] */ - public data object Windows1252 : Charset(16, "windows-1252") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\u0192' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\u02C6' to 0x88, - '\u2030' to 0x89, - '\u0160' to 0x8A, - '\u2039' to 0x8B, - '\u0152' to 0x8C, - '\uFFFD' to 0x8D, - '\u017D' to 0x8E, - '\uFFFD' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\u02DC' to 0x98, - '\u2122' to 0x99, - '\u0161' to 0x9A, - '\u203A' to 0x9B, - '\u0153' to 0x9C, - '\uFFFD' to 0x9D, - '\u017E' to 0x9E, - '\u0178' to 0x9F, - '\u00A0' to 0xA0, - '\u00A1' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\u00A5' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u00AA' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00AF' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00B8' to 0xB8, - '\u00B9' to 0xB9, - '\u00BA' to 0xBA, - '\u00BB' to 0xBB, - '\u00BC' to 0xBC, - '\u00BD' to 0xBD, - '\u00BE' to 0xBE, - '\u00BF' to 0xBF, - '\u00C0' to 0xC0, - '\u00C1' to 0xC1, - '\u00C2' to 0xC2, - '\u00C3' to 0xC3, - '\u00C4' to 0xC4, - '\u00C5' to 0xC5, - '\u00C6' to 0xC6, - '\u00C7' to 0xC7, - '\u00C8' to 0xC8, - '\u00C9' to 0xC9, - '\u00CA' to 0xCA, - '\u00CB' to 0xCB, - '\u00CC' to 0xCC, - '\u00CD' to 0xCD, - '\u00CE' to 0xCE, - '\u00CF' to 0xCF, - '\u00D0' to 0xD0, - '\u00D1' to 0xD1, - '\u00D2' to 0xD2, - '\u00D3' to 0xD3, - '\u00D4' to 0xD4, - '\u00D5' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u00D8' to 0xD8, - '\u00D9' to 0xD9, - '\u00DA' to 0xDA, - '\u00DB' to 0xDB, - '\u00DC' to 0xDC, - '\u00DD' to 0xDD, - '\u00DE' to 0xDE, - '\u00DF' to 0xDF, - '\u00E0' to 0xE0, - '\u00E1' to 0xE1, - '\u00E2' to 0xE2, - '\u00E3' to 0xE3, - '\u00E4' to 0xE4, - '\u00E5' to 0xE5, - '\u00E6' to 0xE6, - '\u00E7' to 0xE7, - '\u00E8' to 0xE8, - '\u00E9' to 0xE9, - '\u00EA' to 0xEA, - '\u00EB' to 0xEB, - '\u00EC' to 0xEC, - '\u00ED' to 0xED, - '\u00EE' to 0xEE, - '\u00EF' to 0xEF, - '\u00F0' to 0xF0, - '\u00F1' to 0xF1, - '\u00F2' to 0xF2, - '\u00F3' to 0xF3, - '\u00F4' to 0xF4, - '\u00F5' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u00F8' to 0xF8, - '\u00F9' to 0xF9, - '\u00FA' to 0xFA, - '\u00FB' to 0xFB, - '\u00FC' to 0xFC, - '\u00FD' to 0xFD, - '\u00FE' to 0xFE, - '\u00FF' to 0xFF, - ) - } - /** Page 17 [CP866: Cyrillic #2] */ public data object CP866 : Charset(17, "IBM866") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1252.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1252.kt new file mode 100644 index 0000000..f434479 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1252.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 16 [Windows-1252] */ +public data object Windows1252 : Charset(16, "windows-1252") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\u0160' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\uFFFD' to 0x8D, + '\u017D' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\u0161' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\uFFFD' to 0x9D, + '\u017E' to 0x9E, + '\u0178' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u00C3' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u00CC' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u00D0' to 0xD0, + '\u00D1' to 0xD1, + '\u00D2' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u00DE' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u00E3' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u00EC' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u00F0' to 0xF0, + '\u00F1' to 0xF1, + '\u00F2' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u00FE' to 0xFE, + '\u00FF' to 0xFF, + ) +} From 8a1ea69f8496f0faa5d2baa116a577df0b0eb283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:31:58 +0200 Subject: [PATCH 15/34] Extract CP866 to its own file --- .../escpos4k/core/encoding/charset/CP866.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt new file mode 100644 index 0000000..ae3c90d --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 17 [CP866: Cyrillic #2] */ +public data object CP866 : Charset(17, "IBM866") { + override val mapping: Map = + mapOf( + '\u0410' to 0x80, + '\u0411' to 0x81, + '\u0412' to 0x82, + '\u0413' to 0x83, + '\u0414' to 0x84, + '\u0415' to 0x85, + '\u0416' to 0x86, + '\u0417' to 0x87, + '\u0418' to 0x88, + '\u0419' to 0x89, + '\u041A' to 0x8A, + '\u041B' to 0x8B, + '\u041C' to 0x8C, + '\u041D' to 0x8D, + '\u041E' to 0x8E, + '\u041F' to 0x8F, + '\u0420' to 0x90, + '\u0421' to 0x91, + '\u0422' to 0x92, + '\u0423' to 0x93, + '\u0424' to 0x94, + '\u0425' to 0x95, + '\u0426' to 0x96, + '\u0427' to 0x97, + '\u0428' to 0x98, + '\u0429' to 0x99, + '\u042A' to 0x9A, + '\u042B' to 0x9B, + '\u042C' to 0x9C, + '\u042D' to 0x9D, + '\u042E' to 0x9E, + '\u042F' to 0x9F, + '\u0430' to 0xA0, + '\u0431' to 0xA1, + '\u0432' to 0xA2, + '\u0433' to 0xA3, + '\u0434' to 0xA4, + '\u0435' to 0xA5, + '\u0436' to 0xA6, + '\u0437' to 0xA7, + '\u0438' to 0xA8, + '\u0439' to 0xA9, + '\u043A' to 0xAA, + '\u043B' to 0xAB, + '\u043C' to 0xAC, + '\u043D' to 0xAD, + '\u043E' to 0xAE, + '\u043F' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u0440' to 0xE0, + '\u0441' to 0xE1, + '\u0442' to 0xE2, + '\u0443' to 0xE3, + '\u0444' to 0xE4, + '\u0445' to 0xE5, + '\u0446' to 0xE6, + '\u0447' to 0xE7, + '\u0448' to 0xE8, + '\u0449' to 0xE9, + '\u044A' to 0xEA, + '\u044B' to 0xEB, + '\u044C' to 0xEC, + '\u044D' to 0xED, + '\u044E' to 0xEE, + '\u044F' to 0xEF, + '\u0401' to 0xF0, + '\u0451' to 0xF1, + '\u0404' to 0xF2, + '\u0454' to 0xF3, + '\u0407' to 0xF4, + '\u0457' to 0xF5, + '\u040E' to 0xF6, + '\u045E' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u2116' to 0xFC, + '\u00A4' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index b1ce1a4..b3ee242 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -58,141 +58,6 @@ public sealed class Charset( // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), - /** Page 17 [CP866: Cyrillic #2] */ - public data object CP866 : Charset(17, "IBM866") { - override val mapping: Map = - mapOf( - '\u0410' to 0x80, - '\u0411' to 0x81, - '\u0412' to 0x82, - '\u0413' to 0x83, - '\u0414' to 0x84, - '\u0415' to 0x85, - '\u0416' to 0x86, - '\u0417' to 0x87, - '\u0418' to 0x88, - '\u0419' to 0x89, - '\u041A' to 0x8A, - '\u041B' to 0x8B, - '\u041C' to 0x8C, - '\u041D' to 0x8D, - '\u041E' to 0x8E, - '\u041F' to 0x8F, - '\u0420' to 0x90, - '\u0421' to 0x91, - '\u0422' to 0x92, - '\u0423' to 0x93, - '\u0424' to 0x94, - '\u0425' to 0x95, - '\u0426' to 0x96, - '\u0427' to 0x97, - '\u0428' to 0x98, - '\u0429' to 0x99, - '\u042A' to 0x9A, - '\u042B' to 0x9B, - '\u042C' to 0x9C, - '\u042D' to 0x9D, - '\u042E' to 0x9E, - '\u042F' to 0x9F, - '\u0430' to 0xA0, - '\u0431' to 0xA1, - '\u0432' to 0xA2, - '\u0433' to 0xA3, - '\u0434' to 0xA4, - '\u0435' to 0xA5, - '\u0436' to 0xA6, - '\u0437' to 0xA7, - '\u0438' to 0xA8, - '\u0439' to 0xA9, - '\u043A' to 0xAA, - '\u043B' to 0xAB, - '\u043C' to 0xAC, - '\u043D' to 0xAD, - '\u043E' to 0xAE, - '\u043F' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u0440' to 0xE0, - '\u0441' to 0xE1, - '\u0442' to 0xE2, - '\u0443' to 0xE3, - '\u0444' to 0xE4, - '\u0445' to 0xE5, - '\u0446' to 0xE6, - '\u0447' to 0xE7, - '\u0448' to 0xE8, - '\u0449' to 0xE9, - '\u044A' to 0xEA, - '\u044B' to 0xEB, - '\u044C' to 0xEC, - '\u044D' to 0xED, - '\u044E' to 0xEE, - '\u044F' to 0xEF, - '\u0401' to 0xF0, - '\u0451' to 0xF1, - '\u0404' to 0xF2, - '\u0454' to 0xF3, - '\u0407' to 0xF4, - '\u0457' to 0xF5, - '\u040E' to 0xF6, - '\u045E' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u2116' to 0xFC, - '\u00A4' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 18 [CP852: Latin 2] */ public data object CP852 : Charset(18, "IBM852") { override val mapping: Map = From 4e59e2cdf3b3e713463c36fd1eb829df11f1fdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:33:51 +0200 Subject: [PATCH 16/34] Extract CP852 to its own file --- .../escpos4k/core/encoding/charset/CP852.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt new file mode 100644 index 0000000..96a836e --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 18 [CP852: Latin 2] */ +public data object CP852 : Charset(18, "IBM852") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u016F' to 0x85, + '\u0107' to 0x86, + '\u00E7' to 0x87, + '\u0142' to 0x88, + '\u00EB' to 0x89, + '\u0150' to 0x8A, + '\u0151' to 0x8B, + '\u00EE' to 0x8C, + '\u0179' to 0x8D, + '\u00C4' to 0x8E, + '\u0106' to 0x8F, + '\u00C9' to 0x90, + '\u0139' to 0x91, + '\u013A' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u013D' to 0x95, + '\u013E' to 0x96, + '\u015A' to 0x97, + '\u015B' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u0164' to 0x9B, + '\u0165' to 0x9C, + '\u0141' to 0x9D, + '\u00D7' to 0x9E, + '\u010D' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u0104' to 0xA4, + '\u0105' to 0xA5, + '\u017D' to 0xA6, + '\u017E' to 0xA7, + '\u0118' to 0xA8, + '\u0119' to 0xA9, + '\u00AC' to 0xAA, + '\u017A' to 0xAB, + '\u010C' to 0xAC, + '\u015F' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u011A' to 0xB7, + '\u015E' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u017B' to 0xBD, + '\u017C' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u0102' to 0xC6, + '\u0103' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u0111' to 0xD0, + '\u0110' to 0xD1, + '\u010E' to 0xD2, + '\u00CB' to 0xD3, + '\u010F' to 0xD4, + '\u0147' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u011B' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u0162' to 0xDD, + '\u016E' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u0143' to 0xE3, + '\u0144' to 0xE4, + '\u0148' to 0xE5, + '\u0160' to 0xE6, + '\u0161' to 0xE7, + '\u0154' to 0xE8, + '\u00DA' to 0xE9, + '\u0155' to 0xEA, + '\u0170' to 0xEB, + '\u00FD' to 0xEC, + '\u00DD' to 0xED, + '\u0163' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u02DD' to 0xF1, + '\u02DB' to 0xF2, + '\u02C7' to 0xF3, + '\u02D8' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u02D9' to 0xFA, + '\u0171' to 0xFB, + '\u0158' to 0xFC, + '\u0159' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index b3ee242..554daa8 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -58,141 +58,6 @@ public sealed class Charset( // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), - /** Page 18 [CP852: Latin 2] */ - public data object CP852 : Charset(18, "IBM852") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u016F' to 0x85, - '\u0107' to 0x86, - '\u00E7' to 0x87, - '\u0142' to 0x88, - '\u00EB' to 0x89, - '\u0150' to 0x8A, - '\u0151' to 0x8B, - '\u00EE' to 0x8C, - '\u0179' to 0x8D, - '\u00C4' to 0x8E, - '\u0106' to 0x8F, - '\u00C9' to 0x90, - '\u0139' to 0x91, - '\u013A' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u013D' to 0x95, - '\u013E' to 0x96, - '\u015A' to 0x97, - '\u015B' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u0164' to 0x9B, - '\u0165' to 0x9C, - '\u0141' to 0x9D, - '\u00D7' to 0x9E, - '\u010D' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u0104' to 0xA4, - '\u0105' to 0xA5, - '\u017D' to 0xA6, - '\u017E' to 0xA7, - '\u0118' to 0xA8, - '\u0119' to 0xA9, - '\u00AC' to 0xAA, - '\u017A' to 0xAB, - '\u010C' to 0xAC, - '\u015F' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u00C1' to 0xB5, - '\u00C2' to 0xB6, - '\u011A' to 0xB7, - '\u015E' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u017B' to 0xBD, - '\u017C' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u0102' to 0xC6, - '\u0103' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u00A4' to 0xCF, - '\u0111' to 0xD0, - '\u0110' to 0xD1, - '\u010E' to 0xD2, - '\u00CB' to 0xD3, - '\u010F' to 0xD4, - '\u0147' to 0xD5, - '\u00CD' to 0xD6, - '\u00CE' to 0xD7, - '\u011B' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u0162' to 0xDD, - '\u016E' to 0xDE, - '\u2580' to 0xDF, - '\u00D3' to 0xE0, - '\u00DF' to 0xE1, - '\u00D4' to 0xE2, - '\u0143' to 0xE3, - '\u0144' to 0xE4, - '\u0148' to 0xE5, - '\u0160' to 0xE6, - '\u0161' to 0xE7, - '\u0154' to 0xE8, - '\u00DA' to 0xE9, - '\u0155' to 0xEA, - '\u0170' to 0xEB, - '\u00FD' to 0xEC, - '\u00DD' to 0xED, - '\u0163' to 0xEE, - '\u00B4' to 0xEF, - '\u00AD' to 0xF0, - '\u02DD' to 0xF1, - '\u02DB' to 0xF2, - '\u02C7' to 0xF3, - '\u02D8' to 0xF4, - '\u00A7' to 0xF5, - '\u00F7' to 0xF6, - '\u00B8' to 0xF7, - '\u00B0' to 0xF8, - '\u00A8' to 0xF9, - '\u02D9' to 0xFA, - '\u0171' to 0xFB, - '\u0158' to 0xFC, - '\u0159' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 19 [CP858: Euro] */ public data object CP858 : Charset(19, "IBM00858") { // Note: two leading zeros override val mapping: Map = From 5915b77c80c387a638067ce26f7b5386ab0c736f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:34:18 +0200 Subject: [PATCH 17/34] Extract CP858 to its own file --- .../escpos4k/core/encoding/charset/CP858.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt new file mode 100644 index 0000000..53d24e6 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 19 [CP858: Euro] */ +public data object CP858 : Charset(19, "IBM00858") { // Note: two leading zeros + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00EF' to 0x8B, + '\u00EE' to 0x8C, + '\u00EC' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00F2' to 0x95, + '\u00FB' to 0x96, + '\u00F9' to 0x97, + '\u00FF' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u00D7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u00C1' to 0xB5, + '\u00C2' to 0xB6, + '\u00C0' to 0xB7, + '\u00A9' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u00A2' to 0xBD, + '\u00A5' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u00E3' to 0xC6, + '\u00C3' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u00F0' to 0xD0, + '\u00D0' to 0xD1, + '\u00CA' to 0xD2, + '\u00CB' to 0xD3, + '\u00C8' to 0xD4, + '\u20AC' to 0xD5, + '\u00CD' to 0xD6, + '\u00CE' to 0xD7, + '\u00CF' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u00A6' to 0xDD, + '\u00CC' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u00D4' to 0xE2, + '\u00D2' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\u00FE' to 0xE7, + '\u00DE' to 0xE8, + '\u00DA' to 0xE9, + '\u00DB' to 0xEA, + '\u00D9' to 0xEB, + '\u00FD' to 0xEC, + '\u00DD' to 0xED, + '\u00AF' to 0xEE, + '\u00B4' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u2017' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u00B8' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 554daa8..5cb6aa1 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -58,141 +58,6 @@ public sealed class Charset( // /** Page 14 [CP737: Greek] */ // CP737(14, TODO()), - /** Page 19 [CP858: Euro] */ - public data object CP858 : Charset(19, "IBM00858") { // Note: two leading zeros - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u00E0' to 0x85, - '\u00E5' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00EF' to 0x8B, - '\u00EE' to 0x8C, - '\u00EC' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u00F2' to 0x95, - '\u00FB' to 0x96, - '\u00F9' to 0x97, - '\u00FF' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00F8' to 0x9B, - '\u00A3' to 0x9C, - '\u00D8' to 0x9D, - '\u00D7' to 0x9E, - '\u0192' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u00AA' to 0xA6, - '\u00BA' to 0xA7, - '\u00BF' to 0xA8, - '\u00AE' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u00C1' to 0xB5, - '\u00C2' to 0xB6, - '\u00C0' to 0xB7, - '\u00A9' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u00A2' to 0xBD, - '\u00A5' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u00E3' to 0xC6, - '\u00C3' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u00A4' to 0xCF, - '\u00F0' to 0xD0, - '\u00D0' to 0xD1, - '\u00CA' to 0xD2, - '\u00CB' to 0xD3, - '\u00C8' to 0xD4, - '\u20AC' to 0xD5, - '\u00CD' to 0xD6, - '\u00CE' to 0xD7, - '\u00CF' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u00A6' to 0xDD, - '\u00CC' to 0xDE, - '\u2580' to 0xDF, - '\u00D3' to 0xE0, - '\u00DF' to 0xE1, - '\u00D4' to 0xE2, - '\u00D2' to 0xE3, - '\u00F5' to 0xE4, - '\u00D5' to 0xE5, - '\u00B5' to 0xE6, - '\u00FE' to 0xE7, - '\u00DE' to 0xE8, - '\u00DA' to 0xE9, - '\u00DB' to 0xEA, - '\u00D9' to 0xEB, - '\u00FD' to 0xEC, - '\u00DD' to 0xED, - '\u00AF' to 0xEE, - '\u00B4' to 0xEF, - '\u00AD' to 0xF0, - '\u00B1' to 0xF1, - '\u2017' to 0xF2, - '\u00BE' to 0xF3, - '\u00B6' to 0xF4, - '\u00A7' to 0xF5, - '\u00F7' to 0xF6, - '\u00B8' to 0xF7, - '\u00B0' to 0xF8, - '\u00A8' to 0xF9, - '\u00B7' to 0xFA, - '\u00B9' to 0xFB, - '\u00B3' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - // /** Page 20 [Thai Character Code 42] */ // Thai_42(20), // From 1810b79c21d3f912d6748f95924e79cea4cf5646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:34:48 +0200 Subject: [PATCH 18/34] Extract CP775 to its own file --- .../escpos4k/core/encoding/charset/CP775.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt new file mode 100644 index 0000000..2a2211f --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 33 [CP775: Baltic Rim] */ +public data object CP775 : Charset(33, "IBM775") { + override val mapping: Map = + mapOf( + '\u0106' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u0101' to 0x83, + '\u00E4' to 0x84, + '\u0123' to 0x85, + '\u00E5' to 0x86, + '\u0107' to 0x87, + '\u0142' to 0x88, + '\u0113' to 0x89, + '\u0156' to 0x8A, + '\u0157' to 0x8B, + '\u012B' to 0x8C, + '\u0179' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u014D' to 0x93, + '\u00F6' to 0x94, + '\u0122' to 0x95, + '\u00A2' to 0x96, + '\u015A' to 0x97, + '\u015B' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u00D7' to 0x9E, + '\u00A4' to 0x9F, + '\u0100' to 0xA0, + '\u012A' to 0xA1, + '\u00F3' to 0xA2, + '\u017B' to 0xA3, + '\u017C' to 0xA4, + '\u017A' to 0xA5, + '\u201D' to 0xA6, + '\u00A6' to 0xA7, + '\u00A9' to 0xA8, + '\u00AE' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u0141' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u0104' to 0xB5, + '\u010C' to 0xB6, + '\u0118' to 0xB7, + '\u0116' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u012E' to 0xBD, + '\u0160' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u0172' to 0xC6, + '\u016A' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u017D' to 0xCF, + '\u0105' to 0xD0, + '\u010D' to 0xD1, + '\u0119' to 0xD2, + '\u0117' to 0xD3, + '\u012F' to 0xD4, + '\u0161' to 0xD5, + '\u0173' to 0xD6, + '\u016B' to 0xD7, + '\u017E' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u00D3' to 0xE0, + '\u00DF' to 0xE1, + '\u014C' to 0xE2, + '\u0143' to 0xE3, + '\u00F5' to 0xE4, + '\u00D5' to 0xE5, + '\u00B5' to 0xE6, + '\u0144' to 0xE7, + '\u0136' to 0xE8, + '\u0137' to 0xE9, + '\u013B' to 0xEA, + '\u013C' to 0xEB, + '\u0146' to 0xEC, + '\u0112' to 0xED, + '\u0145' to 0xEE, + '\u2019' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u201C' to 0xF2, + '\u00BE' to 0xF3, + '\u00B6' to 0xF4, + '\u00A7' to 0xF5, + '\u00F7' to 0xF6, + '\u201E' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u00B9' to 0xFB, + '\u00B3' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 5cb6aa1..80b8e32 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 33 [CP775: Baltic Rim] */ - public data object CP775 : Charset(33, "IBM775") { - override val mapping: Map = - mapOf( - '\u0106' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u0101' to 0x83, - '\u00E4' to 0x84, - '\u0123' to 0x85, - '\u00E5' to 0x86, - '\u0107' to 0x87, - '\u0142' to 0x88, - '\u0113' to 0x89, - '\u0156' to 0x8A, - '\u0157' to 0x8B, - '\u012B' to 0x8C, - '\u0179' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u014D' to 0x93, - '\u00F6' to 0x94, - '\u0122' to 0x95, - '\u00A2' to 0x96, - '\u015A' to 0x97, - '\u015B' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00F8' to 0x9B, - '\u00A3' to 0x9C, - '\u00D8' to 0x9D, - '\u00D7' to 0x9E, - '\u00A4' to 0x9F, - '\u0100' to 0xA0, - '\u012A' to 0xA1, - '\u00F3' to 0xA2, - '\u017B' to 0xA3, - '\u017C' to 0xA4, - '\u017A' to 0xA5, - '\u201D' to 0xA6, - '\u00A6' to 0xA7, - '\u00A9' to 0xA8, - '\u00AE' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u0141' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u0104' to 0xB5, - '\u010C' to 0xB6, - '\u0118' to 0xB7, - '\u0116' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u012E' to 0xBD, - '\u0160' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u0172' to 0xC6, - '\u016A' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u017D' to 0xCF, - '\u0105' to 0xD0, - '\u010D' to 0xD1, - '\u0119' to 0xD2, - '\u0117' to 0xD3, - '\u012F' to 0xD4, - '\u0161' to 0xD5, - '\u0173' to 0xD6, - '\u016B' to 0xD7, - '\u017E' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u00D3' to 0xE0, - '\u00DF' to 0xE1, - '\u014C' to 0xE2, - '\u0143' to 0xE3, - '\u00F5' to 0xE4, - '\u00D5' to 0xE5, - '\u00B5' to 0xE6, - '\u0144' to 0xE7, - '\u0136' to 0xE8, - '\u0137' to 0xE9, - '\u013B' to 0xEA, - '\u013C' to 0xEB, - '\u0146' to 0xEC, - '\u0112' to 0xED, - '\u0145' to 0xEE, - '\u2019' to 0xEF, - '\u00AD' to 0xF0, - '\u00B1' to 0xF1, - '\u201C' to 0xF2, - '\u00BE' to 0xF3, - '\u00B6' to 0xF4, - '\u00A7' to 0xF5, - '\u00F7' to 0xF6, - '\u201E' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u00B9' to 0xFB, - '\u00B3' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 34 [CP855: Cyrillic] */ public data object CP855 : Charset(34, "IBM855") { override val mapping: Map = From bf20998adaf52fe147897cd73119167dea6fde05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:35:12 +0200 Subject: [PATCH 19/34] Extract CP855 to its own file --- .../escpos4k/core/encoding/charset/CP855.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt new file mode 100644 index 0000000..1f8835f --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 34 [CP855: Cyrillic] */ +public data object CP855 : Charset(34, "IBM855") { + override val mapping: Map = + mapOf( + '\u0452' to 0x80, + '\u0402' to 0x81, + '\u0453' to 0x82, + '\u0403' to 0x83, + '\u0451' to 0x84, + '\u0401' to 0x85, + '\u0454' to 0x86, + '\u0404' to 0x87, + '\u0455' to 0x88, + '\u0405' to 0x89, + '\u0456' to 0x8A, + '\u0406' to 0x8B, + '\u0457' to 0x8C, + '\u0407' to 0x8D, + '\u0458' to 0x8E, + '\u0408' to 0x8F, + '\u0459' to 0x90, + '\u0409' to 0x91, + '\u045A' to 0x92, + '\u040A' to 0x93, + '\u045B' to 0x94, + '\u040B' to 0x95, + '\u045C' to 0x96, + '\u040C' to 0x97, + '\u045E' to 0x98, + '\u040E' to 0x99, + '\u045F' to 0x9A, + '\u040F' to 0x9B, + '\u044E' to 0x9C, + '\u042E' to 0x9D, + '\u044A' to 0x9E, + '\u042A' to 0x9F, + '\u0430' to 0xA0, + '\u0410' to 0xA1, + '\u0431' to 0xA2, + '\u0411' to 0xA3, + '\u0446' to 0xA4, + '\u0426' to 0xA5, + '\u0434' to 0xA6, + '\u0414' to 0xA7, + '\u0435' to 0xA8, + '\u0415' to 0xA9, + '\u0444' to 0xAA, + '\u0424' to 0xAB, + '\u0433' to 0xAC, + '\u0413' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u0445' to 0xB5, + '\u0425' to 0xB6, + '\u0438' to 0xB7, + '\u0418' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u0439' to 0xBD, + '\u0419' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u043A' to 0xC6, + '\u041A' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u00A4' to 0xCF, + '\u043B' to 0xD0, + '\u041B' to 0xD1, + '\u043C' to 0xD2, + '\u041C' to 0xD3, + '\u043D' to 0xD4, + '\u041D' to 0xD5, + '\u043E' to 0xD6, + '\u041E' to 0xD7, + '\u043F' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u041F' to 0xDD, + '\u044F' to 0xDE, + '\u2580' to 0xDF, + '\u042F' to 0xE0, + '\u0440' to 0xE1, + '\u0420' to 0xE2, + '\u0441' to 0xE3, + '\u0421' to 0xE4, + '\u0442' to 0xE5, + '\u0422' to 0xE6, + '\u0443' to 0xE7, + '\u0423' to 0xE8, + '\u0436' to 0xE9, + '\u0416' to 0xEA, + '\u0432' to 0xEB, + '\u0412' to 0xEC, + '\u044C' to 0xED, + '\u042C' to 0xEE, + '\u2116' to 0xEF, + '\u00AD' to 0xF0, + '\u044B' to 0xF1, + '\u042B' to 0xF2, + '\u0437' to 0xF3, + '\u0417' to 0xF4, + '\u0448' to 0xF5, + '\u0428' to 0xF6, + '\u044D' to 0xF7, + '\u042D' to 0xF8, + '\u0449' to 0xF9, + '\u0429' to 0xFA, + '\u0447' to 0xFB, + '\u0427' to 0xFC, + '\u00A7' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 80b8e32..3ad835f 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 34 [CP855: Cyrillic] */ - public data object CP855 : Charset(34, "IBM855") { - override val mapping: Map = - mapOf( - '\u0452' to 0x80, - '\u0402' to 0x81, - '\u0453' to 0x82, - '\u0403' to 0x83, - '\u0451' to 0x84, - '\u0401' to 0x85, - '\u0454' to 0x86, - '\u0404' to 0x87, - '\u0455' to 0x88, - '\u0405' to 0x89, - '\u0456' to 0x8A, - '\u0406' to 0x8B, - '\u0457' to 0x8C, - '\u0407' to 0x8D, - '\u0458' to 0x8E, - '\u0408' to 0x8F, - '\u0459' to 0x90, - '\u0409' to 0x91, - '\u045A' to 0x92, - '\u040A' to 0x93, - '\u045B' to 0x94, - '\u040B' to 0x95, - '\u045C' to 0x96, - '\u040C' to 0x97, - '\u045E' to 0x98, - '\u040E' to 0x99, - '\u045F' to 0x9A, - '\u040F' to 0x9B, - '\u044E' to 0x9C, - '\u042E' to 0x9D, - '\u044A' to 0x9E, - '\u042A' to 0x9F, - '\u0430' to 0xA0, - '\u0410' to 0xA1, - '\u0431' to 0xA2, - '\u0411' to 0xA3, - '\u0446' to 0xA4, - '\u0426' to 0xA5, - '\u0434' to 0xA6, - '\u0414' to 0xA7, - '\u0435' to 0xA8, - '\u0415' to 0xA9, - '\u0444' to 0xAA, - '\u0424' to 0xAB, - '\u0433' to 0xAC, - '\u0413' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u0445' to 0xB5, - '\u0425' to 0xB6, - '\u0438' to 0xB7, - '\u0418' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u0439' to 0xBD, - '\u0419' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u043A' to 0xC6, - '\u041A' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u00A4' to 0xCF, - '\u043B' to 0xD0, - '\u041B' to 0xD1, - '\u043C' to 0xD2, - '\u041C' to 0xD3, - '\u043D' to 0xD4, - '\u041D' to 0xD5, - '\u043E' to 0xD6, - '\u041E' to 0xD7, - '\u043F' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u041F' to 0xDD, - '\u044F' to 0xDE, - '\u2580' to 0xDF, - '\u042F' to 0xE0, - '\u0440' to 0xE1, - '\u0420' to 0xE2, - '\u0441' to 0xE3, - '\u0421' to 0xE4, - '\u0442' to 0xE5, - '\u0422' to 0xE6, - '\u0443' to 0xE7, - '\u0423' to 0xE8, - '\u0436' to 0xE9, - '\u0416' to 0xEA, - '\u0432' to 0xEB, - '\u0412' to 0xEC, - '\u044C' to 0xED, - '\u042C' to 0xEE, - '\u2116' to 0xEF, - '\u00AD' to 0xF0, - '\u044B' to 0xF1, - '\u042B' to 0xF2, - '\u0437' to 0xF3, - '\u0417' to 0xF4, - '\u0448' to 0xF5, - '\u0428' to 0xF6, - '\u044D' to 0xF7, - '\u042D' to 0xF8, - '\u0449' to 0xF9, - '\u0429' to 0xFA, - '\u0447' to 0xFB, - '\u0427' to 0xFC, - '\u00A7' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 35 [CP861: Icelandic] */ public data object CP861 : Charset(35, "IBM861") { override val mapping: Map = From 42961815d618539d363f60773fc00e6971c370ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:35:32 +0200 Subject: [PATCH 20/34] Extract CP861 to its own file --- .../escpos4k/core/encoding/charset/CP861.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt new file mode 100644 index 0000000..df0fd08 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 35 [CP861: Icelandic] */ +public data object CP861 : Charset(35, "IBM861") { + override val mapping: Map = + mapOf( + '\u00C7' to 0x80, + '\u00FC' to 0x81, + '\u00E9' to 0x82, + '\u00E2' to 0x83, + '\u00E4' to 0x84, + '\u00E0' to 0x85, + '\u00E5' to 0x86, + '\u00E7' to 0x87, + '\u00EA' to 0x88, + '\u00EB' to 0x89, + '\u00E8' to 0x8A, + '\u00D0' to 0x8B, + '\u00F0' to 0x8C, + '\u00DE' to 0x8D, + '\u00C4' to 0x8E, + '\u00C5' to 0x8F, + '\u00C9' to 0x90, + '\u00E6' to 0x91, + '\u00C6' to 0x92, + '\u00F4' to 0x93, + '\u00F6' to 0x94, + '\u00FE' to 0x95, + '\u00FB' to 0x96, + '\u00DD' to 0x97, + '\u00FD' to 0x98, + '\u00D6' to 0x99, + '\u00DC' to 0x9A, + '\u00F8' to 0x9B, + '\u00A3' to 0x9C, + '\u00D8' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00C1' to 0xA4, + '\u00CD' to 0xA5, + '\u00D3' to 0xA6, + '\u00DA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 3ad835f..2fcad6a 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 35 [CP861: Icelandic] */ - public data object CP861 : Charset(35, "IBM861") { - override val mapping: Map = - mapOf( - '\u00C7' to 0x80, - '\u00FC' to 0x81, - '\u00E9' to 0x82, - '\u00E2' to 0x83, - '\u00E4' to 0x84, - '\u00E0' to 0x85, - '\u00E5' to 0x86, - '\u00E7' to 0x87, - '\u00EA' to 0x88, - '\u00EB' to 0x89, - '\u00E8' to 0x8A, - '\u00D0' to 0x8B, - '\u00F0' to 0x8C, - '\u00DE' to 0x8D, - '\u00C4' to 0x8E, - '\u00C5' to 0x8F, - '\u00C9' to 0x90, - '\u00E6' to 0x91, - '\u00C6' to 0x92, - '\u00F4' to 0x93, - '\u00F6' to 0x94, - '\u00FE' to 0x95, - '\u00FB' to 0x96, - '\u00DD' to 0x97, - '\u00FD' to 0x98, - '\u00D6' to 0x99, - '\u00DC' to 0x9A, - '\u00F8' to 0x9B, - '\u00A3' to 0x9C, - '\u00D8' to 0x9D, - '\u20A7' to 0x9E, - '\u0192' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00C1' to 0xA4, - '\u00CD' to 0xA5, - '\u00D3' to 0xA6, - '\u00DA' to 0xA7, - '\u00BF' to 0xA8, - '\u2310' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u03B1' to 0xE0, - '\u00DF' to 0xE1, - '\u0393' to 0xE2, - '\u03C0' to 0xE3, - '\u03A3' to 0xE4, - '\u03C3' to 0xE5, - '\u00B5' to 0xE6, - '\u03C4' to 0xE7, - '\u03A6' to 0xE8, - '\u0398' to 0xE9, - '\u03A9' to 0xEA, - '\u03B4' to 0xEB, - '\u221E' to 0xEC, - '\u03C6' to 0xED, - '\u03B5' to 0xEE, - '\u2229' to 0xEF, - '\u2261' to 0xF0, - '\u00B1' to 0xF1, - '\u2265' to 0xF2, - '\u2264' to 0xF3, - '\u2320' to 0xF4, - '\u2321' to 0xF5, - '\u00F7' to 0xF6, - '\u2248' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u207F' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 36 [CP862: Hebrew] */ public data object CP862 : Charset(36, "IBM862") { override val mapping: Map = From e08dadfd27f633b0a3cd4163bd7c246521081fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:36:06 +0200 Subject: [PATCH 21/34] Extract CP862 to its own file --- .../escpos4k/core/encoding/charset/CP862.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt new file mode 100644 index 0000000..b3cc947 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 36 [CP862: Hebrew] */ +public data object CP862 : Charset(36, "IBM862") { + override val mapping: Map = + mapOf( + '\u05D0' to 0x80, + '\u05D1' to 0x81, + '\u05D2' to 0x82, + '\u05D3' to 0x83, + '\u05D4' to 0x84, + '\u05D5' to 0x85, + '\u05D6' to 0x86, + '\u05D7' to 0x87, + '\u05D8' to 0x88, + '\u05D9' to 0x89, + '\u05DA' to 0x8A, + '\u05DB' to 0x8B, + '\u05DC' to 0x8C, + '\u05DD' to 0x8D, + '\u05DE' to 0x8E, + '\u05DF' to 0x8F, + '\u05E0' to 0x90, + '\u05E1' to 0x91, + '\u05E2' to 0x92, + '\u05E3' to 0x93, + '\u05E4' to 0x94, + '\u05E5' to 0x95, + '\u05E6' to 0x96, + '\u05E7' to 0x97, + '\u05E8' to 0x98, + '\u05E9' to 0x99, + '\u05EA' to 0x9A, + '\u00A2' to 0x9B, + '\u00A3' to 0x9C, + '\u00A5' to 0x9D, + '\u20A7' to 0x9E, + '\u0192' to 0x9F, + '\u00E1' to 0xA0, + '\u00ED' to 0xA1, + '\u00F3' to 0xA2, + '\u00FA' to 0xA3, + '\u00F1' to 0xA4, + '\u00D1' to 0xA5, + '\u00AA' to 0xA6, + '\u00BA' to 0xA7, + '\u00BF' to 0xA8, + '\u2310' to 0xA9, + '\u00AC' to 0xAA, + '\u00BD' to 0xAB, + '\u00BC' to 0xAC, + '\u00A1' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u2561' to 0xB5, + '\u2562' to 0xB6, + '\u2556' to 0xB7, + '\u2555' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u255C' to 0xBD, + '\u255B' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u255E' to 0xC6, + '\u255F' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u2567' to 0xCF, + '\u2568' to 0xD0, + '\u2564' to 0xD1, + '\u2565' to 0xD2, + '\u2559' to 0xD3, + '\u2558' to 0xD4, + '\u2552' to 0xD5, + '\u2553' to 0xD6, + '\u256B' to 0xD7, + '\u256A' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u258C' to 0xDD, + '\u2590' to 0xDE, + '\u2580' to 0xDF, + '\u03B1' to 0xE0, + '\u00DF' to 0xE1, + '\u0393' to 0xE2, + '\u03C0' to 0xE3, + '\u03A3' to 0xE4, + '\u03C3' to 0xE5, + '\u00B5' to 0xE6, + '\u03C4' to 0xE7, + '\u03A6' to 0xE8, + '\u0398' to 0xE9, + '\u03A9' to 0xEA, + '\u03B4' to 0xEB, + '\u221E' to 0xEC, + '\u03C6' to 0xED, + '\u03B5' to 0xEE, + '\u2229' to 0xEF, + '\u2261' to 0xF0, + '\u00B1' to 0xF1, + '\u2265' to 0xF2, + '\u2264' to 0xF3, + '\u2320' to 0xF4, + '\u2321' to 0xF5, + '\u00F7' to 0xF6, + '\u2248' to 0xF7, + '\u00B0' to 0xF8, + '\u2219' to 0xF9, + '\u00B7' to 0xFA, + '\u221A' to 0xFB, + '\u207F' to 0xFC, + '\u00B2' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 2fcad6a..c85bba4 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 36 [CP862: Hebrew] */ - public data object CP862 : Charset(36, "IBM862") { - override val mapping: Map = - mapOf( - '\u05D0' to 0x80, - '\u05D1' to 0x81, - '\u05D2' to 0x82, - '\u05D3' to 0x83, - '\u05D4' to 0x84, - '\u05D5' to 0x85, - '\u05D6' to 0x86, - '\u05D7' to 0x87, - '\u05D8' to 0x88, - '\u05D9' to 0x89, - '\u05DA' to 0x8A, - '\u05DB' to 0x8B, - '\u05DC' to 0x8C, - '\u05DD' to 0x8D, - '\u05DE' to 0x8E, - '\u05DF' to 0x8F, - '\u05E0' to 0x90, - '\u05E1' to 0x91, - '\u05E2' to 0x92, - '\u05E3' to 0x93, - '\u05E4' to 0x94, - '\u05E5' to 0x95, - '\u05E6' to 0x96, - '\u05E7' to 0x97, - '\u05E8' to 0x98, - '\u05E9' to 0x99, - '\u05EA' to 0x9A, - '\u00A2' to 0x9B, - '\u00A3' to 0x9C, - '\u00A5' to 0x9D, - '\u20A7' to 0x9E, - '\u0192' to 0x9F, - '\u00E1' to 0xA0, - '\u00ED' to 0xA1, - '\u00F3' to 0xA2, - '\u00FA' to 0xA3, - '\u00F1' to 0xA4, - '\u00D1' to 0xA5, - '\u00AA' to 0xA6, - '\u00BA' to 0xA7, - '\u00BF' to 0xA8, - '\u2310' to 0xA9, - '\u00AC' to 0xAA, - '\u00BD' to 0xAB, - '\u00BC' to 0xAC, - '\u00A1' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u2561' to 0xB5, - '\u2562' to 0xB6, - '\u2556' to 0xB7, - '\u2555' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u255C' to 0xBD, - '\u255B' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u255E' to 0xC6, - '\u255F' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u2567' to 0xCF, - '\u2568' to 0xD0, - '\u2564' to 0xD1, - '\u2565' to 0xD2, - '\u2559' to 0xD3, - '\u2558' to 0xD4, - '\u2552' to 0xD5, - '\u2553' to 0xD6, - '\u256B' to 0xD7, - '\u256A' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u258C' to 0xDD, - '\u2590' to 0xDE, - '\u2580' to 0xDF, - '\u03B1' to 0xE0, - '\u00DF' to 0xE1, - '\u0393' to 0xE2, - '\u03C0' to 0xE3, - '\u03A3' to 0xE4, - '\u03C3' to 0xE5, - '\u00B5' to 0xE6, - '\u03C4' to 0xE7, - '\u03A6' to 0xE8, - '\u0398' to 0xE9, - '\u03A9' to 0xEA, - '\u03B4' to 0xEB, - '\u221E' to 0xEC, - '\u03C6' to 0xED, - '\u03B5' to 0xEE, - '\u2229' to 0xEF, - '\u2261' to 0xF0, - '\u00B1' to 0xF1, - '\u2265' to 0xF2, - '\u2264' to 0xF3, - '\u2320' to 0xF4, - '\u2321' to 0xF5, - '\u00F7' to 0xF6, - '\u2248' to 0xF7, - '\u00B0' to 0xF8, - '\u2219' to 0xF9, - '\u00B7' to 0xFA, - '\u221A' to 0xFB, - '\u207F' to 0xFC, - '\u00B2' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 37 [CP864: Arabic] */ public data object CP864 : Charset(37, "IBM864") { override val mapping: Map = From 2b1070d49b480dbeef1f7c000a1ae8b8d725c52b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:36:32 +0200 Subject: [PATCH 22/34] Extract CP864 to its own file --- .../escpos4k/core/encoding/charset/CP864.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt new file mode 100644 index 0000000..bfc727a --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 37 [CP864: Arabic] */ +public data object CP864 : Charset(37, "IBM864") { + override val mapping: Map = + mapOf( + '\u00B0' to 0x80, + '\u00B7' to 0x81, + '\u2219' to 0x82, + '\u221A' to 0x83, + '\u2592' to 0x84, + '\u2500' to 0x85, + '\u2502' to 0x86, + '\u253C' to 0x87, + '\u2524' to 0x88, + '\u252C' to 0x89, + '\u251C' to 0x8A, + '\u2534' to 0x8B, + '\u2510' to 0x8C, + '\u250C' to 0x8D, + '\u2514' to 0x8E, + '\u2518' to 0x8F, + '\u03B2' to 0x90, + '\u221E' to 0x91, + '\u03C6' to 0x92, + '\u00B1' to 0x93, + '\u00BD' to 0x94, + '\u00BC' to 0x95, + '\u2248' to 0x96, + '\u00AB' to 0x97, + '\u00BB' to 0x98, + '\uFEF7' to 0x99, + '\uFEF8' to 0x9A, + '\uFFFD' to 0x9B, + '\uFFFD' to 0x9C, + '\uFEFB' to 0x9D, + '\uFEFC' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\u00AD' to 0xA1, + '\uFE82' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\uFE84' to 0xA5, + '\uFFFD' to 0xA6, + '\uFFFD' to 0xA7, + '\uFE8E' to 0xA8, + '\uFE8F' to 0xA9, + '\uFE95' to 0xAA, + '\uFE99' to 0xAB, + '\u060C' to 0xAC, + '\uFE9D' to 0xAD, + '\uFEA1' to 0xAE, + '\uFEA5' to 0xAF, + '\u0660' to 0xB0, + '\u0661' to 0xB1, + '\u0662' to 0xB2, + '\u0663' to 0xB3, + '\u0664' to 0xB4, + '\u0665' to 0xB5, + '\u0666' to 0xB6, + '\u0667' to 0xB7, + '\u0668' to 0xB8, + '\u0669' to 0xB9, + '\uFED1' to 0xBA, + '\u061B' to 0xBB, + '\uFEB1' to 0xBC, + '\uFEB5' to 0xBD, + '\uFEB9' to 0xBE, + '\u061F' to 0xBF, + '\u00A2' to 0xC0, + '\uFE80' to 0xC1, + '\uFE81' to 0xC2, + '\uFE83' to 0xC3, + '\uFE85' to 0xC4, + '\uFECA' to 0xC5, + '\uFE8B' to 0xC6, + '\uFE8D' to 0xC7, + '\uFE91' to 0xC8, + '\uFE93' to 0xC9, + '\uFE97' to 0xCA, + '\uFE9B' to 0xCB, + '\uFE9F' to 0xCC, + '\uFEA3' to 0xCD, + '\uFEA7' to 0xCE, + '\uFEA9' to 0xCF, + '\uFEAB' to 0xD0, + '\uFEAD' to 0xD1, + '\uFEAF' to 0xD2, + '\uFEB3' to 0xD3, + '\uFEB7' to 0xD4, + '\uFEBB' to 0xD5, + '\uFEBF' to 0xD6, + '\uFEC1' to 0xD7, + '\uFEC5' to 0xD8, + '\uFECB' to 0xD9, + '\uFECF' to 0xDA, + '\u00A6' to 0xDB, + '\u00AC' to 0xDC, + '\u00F7' to 0xDD, + '\u00D7' to 0xDE, + '\uFEC9' to 0xDF, + '\u0640' to 0xE0, + '\uFED3' to 0xE1, + '\uFED7' to 0xE2, + '\uFEDB' to 0xE3, + '\uFEDF' to 0xE4, + '\uFEE3' to 0xE5, + '\uFEE7' to 0xE6, + '\uFEEB' to 0xE7, + '\uFEED' to 0xE8, + '\uFEEF' to 0xE9, + '\uFEF3' to 0xEA, + '\uFEBD' to 0xEB, + '\uFECC' to 0xEC, + '\uFECE' to 0xED, + '\uFECD' to 0xEE, + '\uFEE1' to 0xEF, + '\uFE7D' to 0xF0, + '\u0651' to 0xF1, + '\uFEE5' to 0xF2, + '\uFEE9' to 0xF3, + '\uFEEC' to 0xF4, + '\uFEF0' to 0xF5, + '\uFEF2' to 0xF6, + '\uFED0' to 0xF7, + '\uFED5' to 0xF8, + '\uFEF5' to 0xF9, + '\uFEF6' to 0xFA, + '\uFEDD' to 0xFB, + '\uFED9' to 0xFC, + '\uFEF1' to 0xFD, + '\u25A0' to 0xFE, + '\uFFFD' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index c85bba4..bd229d8 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 37 [CP864: Arabic] */ - public data object CP864 : Charset(37, "IBM864") { - override val mapping: Map = - mapOf( - '\u00B0' to 0x80, - '\u00B7' to 0x81, - '\u2219' to 0x82, - '\u221A' to 0x83, - '\u2592' to 0x84, - '\u2500' to 0x85, - '\u2502' to 0x86, - '\u253C' to 0x87, - '\u2524' to 0x88, - '\u252C' to 0x89, - '\u251C' to 0x8A, - '\u2534' to 0x8B, - '\u2510' to 0x8C, - '\u250C' to 0x8D, - '\u2514' to 0x8E, - '\u2518' to 0x8F, - '\u03B2' to 0x90, - '\u221E' to 0x91, - '\u03C6' to 0x92, - '\u00B1' to 0x93, - '\u00BD' to 0x94, - '\u00BC' to 0x95, - '\u2248' to 0x96, - '\u00AB' to 0x97, - '\u00BB' to 0x98, - '\uFEF7' to 0x99, - '\uFEF8' to 0x9A, - '\uFFFD' to 0x9B, - '\uFFFD' to 0x9C, - '\uFEFB' to 0x9D, - '\uFEFC' to 0x9E, - '\uFFFD' to 0x9F, - '\u00A0' to 0xA0, - '\u00AD' to 0xA1, - '\uFE82' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\uFE84' to 0xA5, - '\uFFFD' to 0xA6, - '\uFFFD' to 0xA7, - '\uFE8E' to 0xA8, - '\uFE8F' to 0xA9, - '\uFE95' to 0xAA, - '\uFE99' to 0xAB, - '\u060C' to 0xAC, - '\uFE9D' to 0xAD, - '\uFEA1' to 0xAE, - '\uFEA5' to 0xAF, - '\u0660' to 0xB0, - '\u0661' to 0xB1, - '\u0662' to 0xB2, - '\u0663' to 0xB3, - '\u0664' to 0xB4, - '\u0665' to 0xB5, - '\u0666' to 0xB6, - '\u0667' to 0xB7, - '\u0668' to 0xB8, - '\u0669' to 0xB9, - '\uFED1' to 0xBA, - '\u061B' to 0xBB, - '\uFEB1' to 0xBC, - '\uFEB5' to 0xBD, - '\uFEB9' to 0xBE, - '\u061F' to 0xBF, - '\u00A2' to 0xC0, - '\uFE80' to 0xC1, - '\uFE81' to 0xC2, - '\uFE83' to 0xC3, - '\uFE85' to 0xC4, - '\uFECA' to 0xC5, - '\uFE8B' to 0xC6, - '\uFE8D' to 0xC7, - '\uFE91' to 0xC8, - '\uFE93' to 0xC9, - '\uFE97' to 0xCA, - '\uFE9B' to 0xCB, - '\uFE9F' to 0xCC, - '\uFEA3' to 0xCD, - '\uFEA7' to 0xCE, - '\uFEA9' to 0xCF, - '\uFEAB' to 0xD0, - '\uFEAD' to 0xD1, - '\uFEAF' to 0xD2, - '\uFEB3' to 0xD3, - '\uFEB7' to 0xD4, - '\uFEBB' to 0xD5, - '\uFEBF' to 0xD6, - '\uFEC1' to 0xD7, - '\uFEC5' to 0xD8, - '\uFECB' to 0xD9, - '\uFECF' to 0xDA, - '\u00A6' to 0xDB, - '\u00AC' to 0xDC, - '\u00F7' to 0xDD, - '\u00D7' to 0xDE, - '\uFEC9' to 0xDF, - '\u0640' to 0xE0, - '\uFED3' to 0xE1, - '\uFED7' to 0xE2, - '\uFEDB' to 0xE3, - '\uFEDF' to 0xE4, - '\uFEE3' to 0xE5, - '\uFEE7' to 0xE6, - '\uFEEB' to 0xE7, - '\uFEED' to 0xE8, - '\uFEEF' to 0xE9, - '\uFEF3' to 0xEA, - '\uFEBD' to 0xEB, - '\uFECC' to 0xEC, - '\uFECE' to 0xED, - '\uFECD' to 0xEE, - '\uFEE1' to 0xEF, - '\uFE7D' to 0xF0, - '\u0651' to 0xF1, - '\uFEE5' to 0xF2, - '\uFEE9' to 0xF3, - '\uFEEC' to 0xF4, - '\uFEF0' to 0xF5, - '\uFEF2' to 0xF6, - '\uFED0' to 0xF7, - '\uFED5' to 0xF8, - '\uFEF5' to 0xF9, - '\uFEF6' to 0xFA, - '\uFEDD' to 0xFB, - '\uFED9' to 0xFC, - '\uFEF1' to 0xFD, - '\u25A0' to 0xFE, - '\uFFFD' to 0xFF, - ) - } - /** Page 38 [CP869: Greek] */ public data object CP869 : Charset(38, "IBM869") { override val mapping: Map = From c7f3f2e56c1c9a921533b09147f36aef35491bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:36:51 +0200 Subject: [PATCH 23/34] Extract CP869 to its own file --- .../escpos4k/core/encoding/charset/CP869.kt | 152 ++++++++++++++++++ .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt new file mode 100644 index 0000000..908bcaf --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 38 [CP869: Greek] */ +public data object CP869 : Charset(38, "IBM869") { + override val mapping: Map = + mapOf( + '\uFFFD' to 0x80, + '\uFFFD' to 0x81, + '\uFFFD' to 0x82, + '\uFFFD' to 0x83, + '\uFFFD' to 0x84, + '\uFFFD' to 0x85, + '\u0386' to 0x86, + '\uFFFD' to 0x87, + '\u00B7' to 0x88, + '\u00AC' to 0x89, + '\u00A6' to 0x8A, + '\u2018' to 0x8B, + '\u2019' to 0x8C, + '\u0388' to 0x8D, + '\u2015' to 0x8E, + '\u0389' to 0x8F, + '\u038A' to 0x90, + '\u03AA' to 0x91, + '\u038C' to 0x92, + '\uFFFD' to 0x93, + '\uFFFD' to 0x94, + '\u038E' to 0x95, + '\u03AB' to 0x96, + '\u00A9' to 0x97, + '\u038F' to 0x98, + '\u00B2' to 0x99, + '\u00B3' to 0x9A, + '\u03AC' to 0x9B, + '\u00A3' to 0x9C, + '\u03AD' to 0x9D, + '\u03AE' to 0x9E, + '\u03AF' to 0x9F, + '\u03CA' to 0xA0, + '\u0390' to 0xA1, + '\u03CC' to 0xA2, + '\u03CD' to 0xA3, + '\u0391' to 0xA4, + '\u0392' to 0xA5, + '\u0393' to 0xA6, + '\u0394' to 0xA7, + '\u0395' to 0xA8, + '\u0396' to 0xA9, + '\u0397' to 0xAA, + '\u00BD' to 0xAB, + '\u0398' to 0xAC, + '\u0399' to 0xAD, + '\u00AB' to 0xAE, + '\u00BB' to 0xAF, + '\u2591' to 0xB0, + '\u2592' to 0xB1, + '\u2593' to 0xB2, + '\u2502' to 0xB3, + '\u2524' to 0xB4, + '\u039A' to 0xB5, + '\u039B' to 0xB6, + '\u039C' to 0xB7, + '\u039D' to 0xB8, + '\u2563' to 0xB9, + '\u2551' to 0xBA, + '\u2557' to 0xBB, + '\u255D' to 0xBC, + '\u039E' to 0xBD, + '\u039F' to 0xBE, + '\u2510' to 0xBF, + '\u2514' to 0xC0, + '\u2534' to 0xC1, + '\u252C' to 0xC2, + '\u251C' to 0xC3, + '\u2500' to 0xC4, + '\u253C' to 0xC5, + '\u03A0' to 0xC6, + '\u03A1' to 0xC7, + '\u255A' to 0xC8, + '\u2554' to 0xC9, + '\u2569' to 0xCA, + '\u2566' to 0xCB, + '\u2560' to 0xCC, + '\u2550' to 0xCD, + '\u256C' to 0xCE, + '\u03A3' to 0xCF, + '\u03A4' to 0xD0, + '\u03A5' to 0xD1, + '\u03A6' to 0xD2, + '\u03A7' to 0xD3, + '\u03A8' to 0xD4, + '\u03A9' to 0xD5, + '\u03B1' to 0xD6, + '\u03B2' to 0xD7, + '\u03B3' to 0xD8, + '\u2518' to 0xD9, + '\u250C' to 0xDA, + '\u2588' to 0xDB, + '\u2584' to 0xDC, + '\u03B4' to 0xDD, + '\u03B5' to 0xDE, + '\u2580' to 0xDF, + '\u03B6' to 0xE0, + '\u03B7' to 0xE1, + '\u03B8' to 0xE2, + '\u03B9' to 0xE3, + '\u03BA' to 0xE4, + '\u03BB' to 0xE5, + '\u03BC' to 0xE6, + '\u03BD' to 0xE7, + '\u03BE' to 0xE8, + '\u03BF' to 0xE9, + '\u03C0' to 0xEA, + '\u03C1' to 0xEB, + '\u03C3' to 0xEC, + '\u03C2' to 0xED, + '\u03C4' to 0xEE, + '\u0384' to 0xEF, + '\u00AD' to 0xF0, + '\u00B1' to 0xF1, + '\u03C5' to 0xF2, + '\u03C6' to 0xF3, + '\u03C7' to 0xF4, + '\u00A7' to 0xF5, + '\u03C8' to 0xF6, + '\u0385' to 0xF7, + '\u00B0' to 0xF8, + '\u00A8' to 0xF9, + '\u03C9' to 0xFA, + '\u03CB' to 0xFB, + '\u03B0' to 0xFC, + '\u03CE' to 0xFD, + '\u25A0' to 0xFE, + '\u00A0' to 0xFF, + ) +} diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index bd229d8..1d01ca7 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 38 [CP869: Greek] */ - public data object CP869 : Charset(38, "IBM869") { - override val mapping: Map = - mapOf( - '\uFFFD' to 0x80, - '\uFFFD' to 0x81, - '\uFFFD' to 0x82, - '\uFFFD' to 0x83, - '\uFFFD' to 0x84, - '\uFFFD' to 0x85, - '\u0386' to 0x86, - '\uFFFD' to 0x87, - '\u00B7' to 0x88, - '\u00AC' to 0x89, - '\u00A6' to 0x8A, - '\u2018' to 0x8B, - '\u2019' to 0x8C, - '\u0388' to 0x8D, - '\u2015' to 0x8E, - '\u0389' to 0x8F, - '\u038A' to 0x90, - '\u03AA' to 0x91, - '\u038C' to 0x92, - '\uFFFD' to 0x93, - '\uFFFD' to 0x94, - '\u038E' to 0x95, - '\u03AB' to 0x96, - '\u00A9' to 0x97, - '\u038F' to 0x98, - '\u00B2' to 0x99, - '\u00B3' to 0x9A, - '\u03AC' to 0x9B, - '\u00A3' to 0x9C, - '\u03AD' to 0x9D, - '\u03AE' to 0x9E, - '\u03AF' to 0x9F, - '\u03CA' to 0xA0, - '\u0390' to 0xA1, - '\u03CC' to 0xA2, - '\u03CD' to 0xA3, - '\u0391' to 0xA4, - '\u0392' to 0xA5, - '\u0393' to 0xA6, - '\u0394' to 0xA7, - '\u0395' to 0xA8, - '\u0396' to 0xA9, - '\u0397' to 0xAA, - '\u00BD' to 0xAB, - '\u0398' to 0xAC, - '\u0399' to 0xAD, - '\u00AB' to 0xAE, - '\u00BB' to 0xAF, - '\u2591' to 0xB0, - '\u2592' to 0xB1, - '\u2593' to 0xB2, - '\u2502' to 0xB3, - '\u2524' to 0xB4, - '\u039A' to 0xB5, - '\u039B' to 0xB6, - '\u039C' to 0xB7, - '\u039D' to 0xB8, - '\u2563' to 0xB9, - '\u2551' to 0xBA, - '\u2557' to 0xBB, - '\u255D' to 0xBC, - '\u039E' to 0xBD, - '\u039F' to 0xBE, - '\u2510' to 0xBF, - '\u2514' to 0xC0, - '\u2534' to 0xC1, - '\u252C' to 0xC2, - '\u251C' to 0xC3, - '\u2500' to 0xC4, - '\u253C' to 0xC5, - '\u03A0' to 0xC6, - '\u03A1' to 0xC7, - '\u255A' to 0xC8, - '\u2554' to 0xC9, - '\u2569' to 0xCA, - '\u2566' to 0xCB, - '\u2560' to 0xCC, - '\u2550' to 0xCD, - '\u256C' to 0xCE, - '\u03A3' to 0xCF, - '\u03A4' to 0xD0, - '\u03A5' to 0xD1, - '\u03A6' to 0xD2, - '\u03A7' to 0xD3, - '\u03A8' to 0xD4, - '\u03A9' to 0xD5, - '\u03B1' to 0xD6, - '\u03B2' to 0xD7, - '\u03B3' to 0xD8, - '\u2518' to 0xD9, - '\u250C' to 0xDA, - '\u2588' to 0xDB, - '\u2584' to 0xDC, - '\u03B4' to 0xDD, - '\u03B5' to 0xDE, - '\u2580' to 0xDF, - '\u03B6' to 0xE0, - '\u03B7' to 0xE1, - '\u03B8' to 0xE2, - '\u03B9' to 0xE3, - '\u03BA' to 0xE4, - '\u03BB' to 0xE5, - '\u03BC' to 0xE6, - '\u03BD' to 0xE7, - '\u03BE' to 0xE8, - '\u03BF' to 0xE9, - '\u03C0' to 0xEA, - '\u03C1' to 0xEB, - '\u03C3' to 0xEC, - '\u03C2' to 0xED, - '\u03C4' to 0xEE, - '\u0384' to 0xEF, - '\u00AD' to 0xF0, - '\u00B1' to 0xF1, - '\u03C5' to 0xF2, - '\u03C6' to 0xF3, - '\u03C7' to 0xF4, - '\u00A7' to 0xF5, - '\u03C8' to 0xF6, - '\u0385' to 0xF7, - '\u00B0' to 0xF8, - '\u00A8' to 0xF9, - '\u03C9' to 0xFA, - '\u03CB' to 0xFB, - '\u03B0' to 0xFC, - '\u03CE' to 0xFD, - '\u25A0' to 0xFE, - '\u00A0' to 0xFF, - ) - } - /** Page 39 [ISO8859-2: Latin 2] */ public data object ISO_8859_2 : Charset(39, "ISO-8859-2") { override val mapping: Map = From 5d5e68d6ba51f91517f55ed2342e3cd2fc2fa930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:37:14 +0200 Subject: [PATCH 24/34] Extract ISO_8859_2 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/ISO_8859_2.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_2.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 1d01ca7..da68ca2 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 39 [ISO8859-2: Latin 2] */ - public data object ISO_8859_2 : Charset(39, "ISO-8859-2") { - override val mapping: Map = - mapOf( - '\u0080' to 0x80, - '\u0081' to 0x81, - '\u0082' to 0x82, - '\u0083' to 0x83, - '\u0084' to 0x84, - '\u0085' to 0x85, - '\u0086' to 0x86, - '\u0087' to 0x87, - '\u0088' to 0x88, - '\u0089' to 0x89, - '\u008A' to 0x8A, - '\u008B' to 0x8B, - '\u008C' to 0x8C, - '\u008D' to 0x8D, - '\u008E' to 0x8E, - '\u008F' to 0x8F, - '\u0090' to 0x90, - '\u0091' to 0x91, - '\u0092' to 0x92, - '\u0093' to 0x93, - '\u0094' to 0x94, - '\u0095' to 0x95, - '\u0096' to 0x96, - '\u0097' to 0x97, - '\u0098' to 0x98, - '\u0099' to 0x99, - '\u009A' to 0x9A, - '\u009B' to 0x9B, - '\u009C' to 0x9C, - '\u009D' to 0x9D, - '\u009E' to 0x9E, - '\u009F' to 0x9F, - '\u00A0' to 0xA0, - '\u0104' to 0xA1, - '\u02D8' to 0xA2, - '\u0141' to 0xA3, - '\u00A4' to 0xA4, - '\u013D' to 0xA5, - '\u015A' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u0160' to 0xA9, - '\u015E' to 0xAA, - '\u0164' to 0xAB, - '\u0179' to 0xAC, - '\u00AD' to 0xAD, - '\u017D' to 0xAE, - '\u017B' to 0xAF, - '\u00B0' to 0xB0, - '\u0105' to 0xB1, - '\u02DB' to 0xB2, - '\u0142' to 0xB3, - '\u00B4' to 0xB4, - '\u013E' to 0xB5, - '\u015B' to 0xB6, - '\u02C7' to 0xB7, - '\u00B8' to 0xB8, - '\u0161' to 0xB9, - '\u015F' to 0xBA, - '\u0165' to 0xBB, - '\u017A' to 0xBC, - '\u02DD' to 0xBD, - '\u017E' to 0xBE, - '\u017C' to 0xBF, - '\u0154' to 0xC0, - '\u00C1' to 0xC1, - '\u00C2' to 0xC2, - '\u0102' to 0xC3, - '\u00C4' to 0xC4, - '\u0139' to 0xC5, - '\u0106' to 0xC6, - '\u00C7' to 0xC7, - '\u010C' to 0xC8, - '\u00C9' to 0xC9, - '\u0118' to 0xCA, - '\u00CB' to 0xCB, - '\u011A' to 0xCC, - '\u00CD' to 0xCD, - '\u00CE' to 0xCE, - '\u010E' to 0xCF, - '\u0110' to 0xD0, - '\u0143' to 0xD1, - '\u0147' to 0xD2, - '\u00D3' to 0xD3, - '\u00D4' to 0xD4, - '\u0150' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u0158' to 0xD8, - '\u016E' to 0xD9, - '\u00DA' to 0xDA, - '\u0170' to 0xDB, - '\u00DC' to 0xDC, - '\u00DD' to 0xDD, - '\u0162' to 0xDE, - '\u00DF' to 0xDF, - '\u0155' to 0xE0, - '\u00E1' to 0xE1, - '\u00E2' to 0xE2, - '\u0103' to 0xE3, - '\u00E4' to 0xE4, - '\u013A' to 0xE5, - '\u0107' to 0xE6, - '\u00E7' to 0xE7, - '\u010D' to 0xE8, - '\u00E9' to 0xE9, - '\u0119' to 0xEA, - '\u00EB' to 0xEB, - '\u011B' to 0xEC, - '\u00ED' to 0xED, - '\u00EE' to 0xEE, - '\u010F' to 0xEF, - '\u0111' to 0xF0, - '\u0144' to 0xF1, - '\u0148' to 0xF2, - '\u00F3' to 0xF3, - '\u00F4' to 0xF4, - '\u0151' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u0159' to 0xF8, - '\u016F' to 0xF9, - '\u00FA' to 0xFA, - '\u0171' to 0xFB, - '\u00FC' to 0xFC, - '\u00FD' to 0xFD, - '\u0163' to 0xFE, - '\u02D9' to 0xFF, - ) - } - /** Page 40 [ISO8859-15: Latin 9] */ public data object ISO_8859_15 : Charset(40, "ISO-8859-15") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_2.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_2.kt new file mode 100644 index 0000000..3ee6249 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_2.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 39 [ISO8859-2: Latin 2] */ +public data object ISO_8859_2 : Charset(39, "ISO-8859-2") { + override val mapping: Map = + mapOf( + '\u0080' to 0x80, + '\u0081' to 0x81, + '\u0082' to 0x82, + '\u0083' to 0x83, + '\u0084' to 0x84, + '\u0085' to 0x85, + '\u0086' to 0x86, + '\u0087' to 0x87, + '\u0088' to 0x88, + '\u0089' to 0x89, + '\u008A' to 0x8A, + '\u008B' to 0x8B, + '\u008C' to 0x8C, + '\u008D' to 0x8D, + '\u008E' to 0x8E, + '\u008F' to 0x8F, + '\u0090' to 0x90, + '\u0091' to 0x91, + '\u0092' to 0x92, + '\u0093' to 0x93, + '\u0094' to 0x94, + '\u0095' to 0x95, + '\u0096' to 0x96, + '\u0097' to 0x97, + '\u0098' to 0x98, + '\u0099' to 0x99, + '\u009A' to 0x9A, + '\u009B' to 0x9B, + '\u009C' to 0x9C, + '\u009D' to 0x9D, + '\u009E' to 0x9E, + '\u009F' to 0x9F, + '\u00A0' to 0xA0, + '\u0104' to 0xA1, + '\u02D8' to 0xA2, + '\u0141' to 0xA3, + '\u00A4' to 0xA4, + '\u013D' to 0xA5, + '\u015A' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u0160' to 0xA9, + '\u015E' to 0xAA, + '\u0164' to 0xAB, + '\u0179' to 0xAC, + '\u00AD' to 0xAD, + '\u017D' to 0xAE, + '\u017B' to 0xAF, + '\u00B0' to 0xB0, + '\u0105' to 0xB1, + '\u02DB' to 0xB2, + '\u0142' to 0xB3, + '\u00B4' to 0xB4, + '\u013E' to 0xB5, + '\u015B' to 0xB6, + '\u02C7' to 0xB7, + '\u00B8' to 0xB8, + '\u0161' to 0xB9, + '\u015F' to 0xBA, + '\u0165' to 0xBB, + '\u017A' to 0xBC, + '\u02DD' to 0xBD, + '\u017E' to 0xBE, + '\u017C' to 0xBF, + '\u0154' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u0102' to 0xC3, + '\u00C4' to 0xC4, + '\u0139' to 0xC5, + '\u0106' to 0xC6, + '\u00C7' to 0xC7, + '\u010C' to 0xC8, + '\u00C9' to 0xC9, + '\u0118' to 0xCA, + '\u00CB' to 0xCB, + '\u011A' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u010E' to 0xCF, + '\u0110' to 0xD0, + '\u0143' to 0xD1, + '\u0147' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u0150' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u0158' to 0xD8, + '\u016E' to 0xD9, + '\u00DA' to 0xDA, + '\u0170' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u0162' to 0xDE, + '\u00DF' to 0xDF, + '\u0155' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u0103' to 0xE3, + '\u00E4' to 0xE4, + '\u013A' to 0xE5, + '\u0107' to 0xE6, + '\u00E7' to 0xE7, + '\u010D' to 0xE8, + '\u00E9' to 0xE9, + '\u0119' to 0xEA, + '\u00EB' to 0xEB, + '\u011B' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u010F' to 0xEF, + '\u0111' to 0xF0, + '\u0144' to 0xF1, + '\u0148' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u0151' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u0159' to 0xF8, + '\u016F' to 0xF9, + '\u00FA' to 0xFA, + '\u0171' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u0163' to 0xFE, + '\u02D9' to 0xFF, + ) +} From 164de0cb7224baa9768bdf0284fcabeda88ee79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:37:37 +0200 Subject: [PATCH 25/34] Extract ISO_8859_15 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/ISO_8859_15.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_15.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index da68ca2..7582f4a 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -88,141 +88,6 @@ public sealed class Charset( // /** Page 32 [CP720: Arabic] */ // CP720(32), - /** Page 40 [ISO8859-15: Latin 9] */ - public data object ISO_8859_15 : Charset(40, "ISO-8859-15") { - override val mapping: Map = - mapOf( - '\u0080' to 0x80, - '\u0081' to 0x81, - '\u0082' to 0x82, - '\u0083' to 0x83, - '\u0084' to 0x84, - '\u0085' to 0x85, - '\u0086' to 0x86, - '\u0087' to 0x87, - '\u0088' to 0x88, - '\u0089' to 0x89, - '\u008A' to 0x8A, - '\u008B' to 0x8B, - '\u008C' to 0x8C, - '\u008D' to 0x8D, - '\u008E' to 0x8E, - '\u008F' to 0x8F, - '\u0090' to 0x90, - '\u0091' to 0x91, - '\u0092' to 0x92, - '\u0093' to 0x93, - '\u0094' to 0x94, - '\u0095' to 0x95, - '\u0096' to 0x96, - '\u0097' to 0x97, - '\u0098' to 0x98, - '\u0099' to 0x99, - '\u009A' to 0x9A, - '\u009B' to 0x9B, - '\u009C' to 0x9C, - '\u009D' to 0x9D, - '\u009E' to 0x9E, - '\u009F' to 0x9F, - '\u00A0' to 0xA0, - '\u00A1' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u20AC' to 0xA4, - '\u00A5' to 0xA5, - '\u0160' to 0xA6, - '\u00A7' to 0xA7, - '\u0161' to 0xA8, - '\u00A9' to 0xA9, - '\u00AA' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00AF' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u017D' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u017E' to 0xB8, - '\u00B9' to 0xB9, - '\u00BA' to 0xBA, - '\u00BB' to 0xBB, - '\u0152' to 0xBC, - '\u0153' to 0xBD, - '\u0178' to 0xBE, - '\u00BF' to 0xBF, - '\u00C0' to 0xC0, - '\u00C1' to 0xC1, - '\u00C2' to 0xC2, - '\u00C3' to 0xC3, - '\u00C4' to 0xC4, - '\u00C5' to 0xC5, - '\u00C6' to 0xC6, - '\u00C7' to 0xC7, - '\u00C8' to 0xC8, - '\u00C9' to 0xC9, - '\u00CA' to 0xCA, - '\u00CB' to 0xCB, - '\u00CC' to 0xCC, - '\u00CD' to 0xCD, - '\u00CE' to 0xCE, - '\u00CF' to 0xCF, - '\u00D0' to 0xD0, - '\u00D1' to 0xD1, - '\u00D2' to 0xD2, - '\u00D3' to 0xD3, - '\u00D4' to 0xD4, - '\u00D5' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u00D8' to 0xD8, - '\u00D9' to 0xD9, - '\u00DA' to 0xDA, - '\u00DB' to 0xDB, - '\u00DC' to 0xDC, - '\u00DD' to 0xDD, - '\u00DE' to 0xDE, - '\u00DF' to 0xDF, - '\u00E0' to 0xE0, - '\u00E1' to 0xE1, - '\u00E2' to 0xE2, - '\u00E3' to 0xE3, - '\u00E4' to 0xE4, - '\u00E5' to 0xE5, - '\u00E6' to 0xE6, - '\u00E7' to 0xE7, - '\u00E8' to 0xE8, - '\u00E9' to 0xE9, - '\u00EA' to 0xEA, - '\u00EB' to 0xEB, - '\u00EC' to 0xEC, - '\u00ED' to 0xED, - '\u00EE' to 0xEE, - '\u00EF' to 0xEF, - '\u00F0' to 0xF0, - '\u00F1' to 0xF1, - '\u00F2' to 0xF2, - '\u00F3' to 0xF3, - '\u00F4' to 0xF4, - '\u00F5' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u00F8' to 0xF8, - '\u00F9' to 0xF9, - '\u00FA' to 0xFA, - '\u00FB' to 0xFB, - '\u00FC' to 0xFC, - '\u00FD' to 0xFD, - '\u00FE' to 0xFE, - '\u00FF' to 0xFF, - ) - } - // /** Page 41 [CP1098: Farsi] */ // CP1098(41, TODO()), diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_15.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_15.kt new file mode 100644 index 0000000..9c16d55 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/ISO_8859_15.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 40 [ISO8859-15: Latin 9] */ +public data object ISO_8859_15 : Charset(40, "ISO-8859-15") { + override val mapping: Map = + mapOf( + '\u0080' to 0x80, + '\u0081' to 0x81, + '\u0082' to 0x82, + '\u0083' to 0x83, + '\u0084' to 0x84, + '\u0085' to 0x85, + '\u0086' to 0x86, + '\u0087' to 0x87, + '\u0088' to 0x88, + '\u0089' to 0x89, + '\u008A' to 0x8A, + '\u008B' to 0x8B, + '\u008C' to 0x8C, + '\u008D' to 0x8D, + '\u008E' to 0x8E, + '\u008F' to 0x8F, + '\u0090' to 0x90, + '\u0091' to 0x91, + '\u0092' to 0x92, + '\u0093' to 0x93, + '\u0094' to 0x94, + '\u0095' to 0x95, + '\u0096' to 0x96, + '\u0097' to 0x97, + '\u0098' to 0x98, + '\u0099' to 0x99, + '\u009A' to 0x9A, + '\u009B' to 0x9B, + '\u009C' to 0x9C, + '\u009D' to 0x9D, + '\u009E' to 0x9E, + '\u009F' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u20AC' to 0xA4, + '\u00A5' to 0xA5, + '\u0160' to 0xA6, + '\u00A7' to 0xA7, + '\u0161' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u017D' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u017E' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u0152' to 0xBC, + '\u0153' to 0xBD, + '\u0178' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u00C3' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u00CC' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u00D0' to 0xD0, + '\u00D1' to 0xD1, + '\u00D2' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u00DE' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u00E3' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u00EC' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u00F0' to 0xF0, + '\u00F1' to 0xF1, + '\u00F2' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u00FE' to 0xFE, + '\u00FF' to 0xFF, + ) +} From f6708893188b5ca1dc5eea078927c9a1a713c822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:38:11 +0200 Subject: [PATCH 26/34] Extract Windows1250 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1250.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1250.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 7582f4a..a4acd01 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 45 [Windows-1250] */ - public data object Windows1250 : Charset(45, "windows-1250") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\uFFFD' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\uFFFD' to 0x88, - '\u2030' to 0x89, - '\u0160' to 0x8A, - '\u2039' to 0x8B, - '\u015A' to 0x8C, - '\u0164' to 0x8D, - '\u017D' to 0x8E, - '\u0179' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\uFFFD' to 0x98, - '\u2122' to 0x99, - '\u0161' to 0x9A, - '\u203A' to 0x9B, - '\u015B' to 0x9C, - '\u0165' to 0x9D, - '\u017E' to 0x9E, - '\u017A' to 0x9F, - '\u00A0' to 0xA0, - '\u02C7' to 0xA1, - '\u02D8' to 0xA2, - '\u0141' to 0xA3, - '\u00A4' to 0xA4, - '\u0104' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u015E' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u017B' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u02DB' to 0xB2, - '\u0142' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00B8' to 0xB8, - '\u0105' to 0xB9, - '\u015F' to 0xBA, - '\u00BB' to 0xBB, - '\u013D' to 0xBC, - '\u02DD' to 0xBD, - '\u013E' to 0xBE, - '\u017C' to 0xBF, - '\u0154' to 0xC0, - '\u00C1' to 0xC1, - '\u00C2' to 0xC2, - '\u0102' to 0xC3, - '\u00C4' to 0xC4, - '\u0139' to 0xC5, - '\u0106' to 0xC6, - '\u00C7' to 0xC7, - '\u010C' to 0xC8, - '\u00C9' to 0xC9, - '\u0118' to 0xCA, - '\u00CB' to 0xCB, - '\u011A' to 0xCC, - '\u00CD' to 0xCD, - '\u00CE' to 0xCE, - '\u010E' to 0xCF, - '\u0110' to 0xD0, - '\u0143' to 0xD1, - '\u0147' to 0xD2, - '\u00D3' to 0xD3, - '\u00D4' to 0xD4, - '\u0150' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u0158' to 0xD8, - '\u016E' to 0xD9, - '\u00DA' to 0xDA, - '\u0170' to 0xDB, - '\u00DC' to 0xDC, - '\u00DD' to 0xDD, - '\u0162' to 0xDE, - '\u00DF' to 0xDF, - '\u0155' to 0xE0, - '\u00E1' to 0xE1, - '\u00E2' to 0xE2, - '\u0103' to 0xE3, - '\u00E4' to 0xE4, - '\u013A' to 0xE5, - '\u0107' to 0xE6, - '\u00E7' to 0xE7, - '\u010D' to 0xE8, - '\u00E9' to 0xE9, - '\u0119' to 0xEA, - '\u00EB' to 0xEB, - '\u011B' to 0xEC, - '\u00ED' to 0xED, - '\u00EE' to 0xEE, - '\u010F' to 0xEF, - '\u0111' to 0xF0, - '\u0144' to 0xF1, - '\u0148' to 0xF2, - '\u00F3' to 0xF3, - '\u00F4' to 0xF4, - '\u0151' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u0159' to 0xF8, - '\u016F' to 0xF9, - '\u00FA' to 0xFA, - '\u0171' to 0xFB, - '\u00FC' to 0xFC, - '\u00FD' to 0xFD, - '\u0163' to 0xFE, - '\u02D9' to 0xFF, - ) - } - /** Page 46 [Windows-1251] */ public data object Windows1251 : Charset(46, "windows-1251") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1250.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1250.kt new file mode 100644 index 0000000..de15f51 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1250.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 45 [Windows-1250] */ +public data object Windows1250 : Charset(45, "windows-1250") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\uFFFD' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\uFFFD' to 0x88, + '\u2030' to 0x89, + '\u0160' to 0x8A, + '\u2039' to 0x8B, + '\u015A' to 0x8C, + '\u0164' to 0x8D, + '\u017D' to 0x8E, + '\u0179' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\u0161' to 0x9A, + '\u203A' to 0x9B, + '\u015B' to 0x9C, + '\u0165' to 0x9D, + '\u017E' to 0x9E, + '\u017A' to 0x9F, + '\u00A0' to 0xA0, + '\u02C7' to 0xA1, + '\u02D8' to 0xA2, + '\u0141' to 0xA3, + '\u00A4' to 0xA4, + '\u0104' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u015E' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u017B' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u02DB' to 0xB2, + '\u0142' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u0105' to 0xB9, + '\u015F' to 0xBA, + '\u00BB' to 0xBB, + '\u013D' to 0xBC, + '\u02DD' to 0xBD, + '\u013E' to 0xBE, + '\u017C' to 0xBF, + '\u0154' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u0102' to 0xC3, + '\u00C4' to 0xC4, + '\u0139' to 0xC5, + '\u0106' to 0xC6, + '\u00C7' to 0xC7, + '\u010C' to 0xC8, + '\u00C9' to 0xC9, + '\u0118' to 0xCA, + '\u00CB' to 0xCB, + '\u011A' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u010E' to 0xCF, + '\u0110' to 0xD0, + '\u0143' to 0xD1, + '\u0147' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u0150' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u0158' to 0xD8, + '\u016E' to 0xD9, + '\u00DA' to 0xDA, + '\u0170' to 0xDB, + '\u00DC' to 0xDC, + '\u00DD' to 0xDD, + '\u0162' to 0xDE, + '\u00DF' to 0xDF, + '\u0155' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u0103' to 0xE3, + '\u00E4' to 0xE4, + '\u013A' to 0xE5, + '\u0107' to 0xE6, + '\u00E7' to 0xE7, + '\u010D' to 0xE8, + '\u00E9' to 0xE9, + '\u0119' to 0xEA, + '\u00EB' to 0xEB, + '\u011B' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u010F' to 0xEF, + '\u0111' to 0xF0, + '\u0144' to 0xF1, + '\u0148' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u0151' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u0159' to 0xF8, + '\u016F' to 0xF9, + '\u00FA' to 0xFA, + '\u0171' to 0xFB, + '\u00FC' to 0xFC, + '\u00FD' to 0xFD, + '\u0163' to 0xFE, + '\u02D9' to 0xFF, + ) +} From a8bb52f6072632ef4278aed81ee1652b61365d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:38:48 +0200 Subject: [PATCH 27/34] Extract Windows1251 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1251.kt | 152 ++++++++++++++++++ .../escpos4k/core/CommandBuilderTest.kt | 11 +- 3 files changed, 158 insertions(+), 140 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1251.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index a4acd01..1e73125 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 46 [Windows-1251] */ - public data object Windows1251 : Charset(46, "windows-1251") { - override val mapping: Map = - mapOf( - '\u0402' to 0x80, - '\u0403' to 0x81, - '\u201A' to 0x82, - '\u0453' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\u20AC' to 0x88, - '\u2030' to 0x89, - '\u0409' to 0x8A, - '\u2039' to 0x8B, - '\u040A' to 0x8C, - '\u040C' to 0x8D, - '\u040B' to 0x8E, - '\u040F' to 0x8F, - '\u0452' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\uFFFD' to 0x98, - '\u2122' to 0x99, - '\u0459' to 0x9A, - '\u203A' to 0x9B, - '\u045A' to 0x9C, - '\u045C' to 0x9D, - '\u045B' to 0x9E, - '\u045F' to 0x9F, - '\u00A0' to 0xA0, - '\u040E' to 0xA1, - '\u045E' to 0xA2, - '\u0408' to 0xA3, - '\u00A4' to 0xA4, - '\u0490' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u0401' to 0xA8, - '\u00A9' to 0xA9, - '\u0404' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u0407' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u0406' to 0xB2, - '\u0456' to 0xB3, - '\u0491' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u0451' to 0xB8, - '\u2116' to 0xB9, - '\u0454' to 0xBA, - '\u00BB' to 0xBB, - '\u0458' to 0xBC, - '\u0405' to 0xBD, - '\u0455' to 0xBE, - '\u0457' to 0xBF, - '\u0410' to 0xC0, - '\u0411' to 0xC1, - '\u0412' to 0xC2, - '\u0413' to 0xC3, - '\u0414' to 0xC4, - '\u0415' to 0xC5, - '\u0416' to 0xC6, - '\u0417' to 0xC7, - '\u0418' to 0xC8, - '\u0419' to 0xC9, - '\u041A' to 0xCA, - '\u041B' to 0xCB, - '\u041C' to 0xCC, - '\u041D' to 0xCD, - '\u041E' to 0xCE, - '\u041F' to 0xCF, - '\u0420' to 0xD0, - '\u0421' to 0xD1, - '\u0422' to 0xD2, - '\u0423' to 0xD3, - '\u0424' to 0xD4, - '\u0425' to 0xD5, - '\u0426' to 0xD6, - '\u0427' to 0xD7, - '\u0428' to 0xD8, - '\u0429' to 0xD9, - '\u042A' to 0xDA, - '\u042B' to 0xDB, - '\u042C' to 0xDC, - '\u042D' to 0xDD, - '\u042E' to 0xDE, - '\u042F' to 0xDF, - '\u0430' to 0xE0, - '\u0431' to 0xE1, - '\u0432' to 0xE2, - '\u0433' to 0xE3, - '\u0434' to 0xE4, - '\u0435' to 0xE5, - '\u0436' to 0xE6, - '\u0437' to 0xE7, - '\u0438' to 0xE8, - '\u0439' to 0xE9, - '\u043A' to 0xEA, - '\u043B' to 0xEB, - '\u043C' to 0xEC, - '\u043D' to 0xED, - '\u043E' to 0xEE, - '\u043F' to 0xEF, - '\u0440' to 0xF0, - '\u0441' to 0xF1, - '\u0442' to 0xF2, - '\u0443' to 0xF3, - '\u0444' to 0xF4, - '\u0445' to 0xF5, - '\u0446' to 0xF6, - '\u0447' to 0xF7, - '\u0448' to 0xF8, - '\u0449' to 0xF9, - '\u044A' to 0xFA, - '\u044B' to 0xFB, - '\u044C' to 0xFC, - '\u044D' to 0xFD, - '\u044E' to 0xFE, - '\u044F' to 0xFF, - ) - } - /** Page 47 [Windows-1253] */ public data object Windows1253 : Charset(47, "windows-1253") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1251.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1251.kt new file mode 100644 index 0000000..16fec4d --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1251.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 46 [Windows-1251] */ +public data object Windows1251 : Charset(46, "windows-1251") { + override val mapping: Map = + mapOf( + '\u0402' to 0x80, + '\u0403' to 0x81, + '\u201A' to 0x82, + '\u0453' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u20AC' to 0x88, + '\u2030' to 0x89, + '\u0409' to 0x8A, + '\u2039' to 0x8B, + '\u040A' to 0x8C, + '\u040C' to 0x8D, + '\u040B' to 0x8E, + '\u040F' to 0x8F, + '\u0452' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\u0459' to 0x9A, + '\u203A' to 0x9B, + '\u045A' to 0x9C, + '\u045C' to 0x9D, + '\u045B' to 0x9E, + '\u045F' to 0x9F, + '\u00A0' to 0xA0, + '\u040E' to 0xA1, + '\u045E' to 0xA2, + '\u0408' to 0xA3, + '\u00A4' to 0xA4, + '\u0490' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u0401' to 0xA8, + '\u00A9' to 0xA9, + '\u0404' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u0407' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u0406' to 0xB2, + '\u0456' to 0xB3, + '\u0491' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u0451' to 0xB8, + '\u2116' to 0xB9, + '\u0454' to 0xBA, + '\u00BB' to 0xBB, + '\u0458' to 0xBC, + '\u0405' to 0xBD, + '\u0455' to 0xBE, + '\u0457' to 0xBF, + '\u0410' to 0xC0, + '\u0411' to 0xC1, + '\u0412' to 0xC2, + '\u0413' to 0xC3, + '\u0414' to 0xC4, + '\u0415' to 0xC5, + '\u0416' to 0xC6, + '\u0417' to 0xC7, + '\u0418' to 0xC8, + '\u0419' to 0xC9, + '\u041A' to 0xCA, + '\u041B' to 0xCB, + '\u041C' to 0xCC, + '\u041D' to 0xCD, + '\u041E' to 0xCE, + '\u041F' to 0xCF, + '\u0420' to 0xD0, + '\u0421' to 0xD1, + '\u0422' to 0xD2, + '\u0423' to 0xD3, + '\u0424' to 0xD4, + '\u0425' to 0xD5, + '\u0426' to 0xD6, + '\u0427' to 0xD7, + '\u0428' to 0xD8, + '\u0429' to 0xD9, + '\u042A' to 0xDA, + '\u042B' to 0xDB, + '\u042C' to 0xDC, + '\u042D' to 0xDD, + '\u042E' to 0xDE, + '\u042F' to 0xDF, + '\u0430' to 0xE0, + '\u0431' to 0xE1, + '\u0432' to 0xE2, + '\u0433' to 0xE3, + '\u0434' to 0xE4, + '\u0435' to 0xE5, + '\u0436' to 0xE6, + '\u0437' to 0xE7, + '\u0438' to 0xE8, + '\u0439' to 0xE9, + '\u043A' to 0xEA, + '\u043B' to 0xEB, + '\u043C' to 0xEC, + '\u043D' to 0xED, + '\u043E' to 0xEE, + '\u043F' to 0xEF, + '\u0440' to 0xF0, + '\u0441' to 0xF1, + '\u0442' to 0xF2, + '\u0443' to 0xF3, + '\u0444' to 0xF4, + '\u0445' to 0xF5, + '\u0446' to 0xF6, + '\u0447' to 0xF7, + '\u0448' to 0xF8, + '\u0449' to 0xF9, + '\u044A' to 0xFA, + '\u044B' to 0xFB, + '\u044C' to 0xFC, + '\u044D' to 0xFD, + '\u044E' to 0xFE, + '\u044F' to 0xFF, + ) +} diff --git a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt index 0d4593b..f25e730 100644 --- a/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt +++ b/escpos4k/src/commonTest/kotlin/cz/multiplatform/escpos4k/core/CommandBuilderTest.kt @@ -2,6 +2,7 @@ package cz.multiplatform.escpos4k.core import cz.multiplatform.escpos4k.core.encoding.charset.Charset import cz.multiplatform.escpos4k.core.encoding.charset.IBM850 +import cz.multiplatform.escpos4k.core.encoding.charset.Windows1251 import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly @@ -36,10 +37,10 @@ class CommandBuilderTest : FunSpec() { charset(Charset.default) charset(IBM850) charset(IBM850) - charset(Charset.Windows1251) + charset(Windows1251) } builder.commands shouldContainExactly - initSequence + Command.SelectCharset(IBM850) + Command.SelectCharset(Charset.Windows1251) + initSequence + Command.SelectCharset(IBM850) + Command.SelectCharset(Windows1251) } } @@ -50,7 +51,7 @@ class CommandBuilderTest : FunSpec() { withCharset(Charset.default) { withCharset(IBM850) { withCharset(IBM850) { - withCharset(Charset.Windows1251) { + withCharset(Windows1251) { text("innermost") // } } @@ -61,8 +62,8 @@ class CommandBuilderTest : FunSpec() { builder.commands shouldContainExactly initSequence + Command.SelectCharset(IBM850) + - Command.SelectCharset(Charset.Windows1251) + - Command.Text("innermost", Charset.Windows1251) + + Command.SelectCharset(Windows1251) + + Command.Text("innermost", Windows1251) + Command.SelectCharset(IBM850) + Command.SelectCharset(Charset.default) } From 635340eaf1aef4759067552c71cc50bb4f626ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:39:12 +0200 Subject: [PATCH 28/34] Extract Windows1253 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1253.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1253.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 1e73125..19de592 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 47 [Windows-1253] */ - public data object Windows1253 : Charset(47, "windows-1253") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\u0192' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\uFFFD' to 0x88, - '\u2030' to 0x89, - '\uFFFD' to 0x8A, - '\u2039' to 0x8B, - '\uFFFD' to 0x8C, - '\uFFFD' to 0x8D, - '\uFFFD' to 0x8E, - '\uFFFD' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\uFFFD' to 0x98, - '\u2122' to 0x99, - '\uFFFD' to 0x9A, - '\u203A' to 0x9B, - '\uFFFD' to 0x9C, - '\uFFFD' to 0x9D, - '\uFFFD' to 0x9E, - '\uFFFD' to 0x9F, - '\u00A0' to 0xA0, - '\u0385' to 0xA1, - '\u0386' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\u00A5' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\uFFFD' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u2015' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u0384' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u0388' to 0xB8, - '\u0389' to 0xB9, - '\u038A' to 0xBA, - '\u00BB' to 0xBB, - '\u038C' to 0xBC, - '\u00BD' to 0xBD, - '\u038E' to 0xBE, - '\u038F' to 0xBF, - '\u0390' to 0xC0, - '\u0391' to 0xC1, - '\u0392' to 0xC2, - '\u0393' to 0xC3, - '\u0394' to 0xC4, - '\u0395' to 0xC5, - '\u0396' to 0xC6, - '\u0397' to 0xC7, - '\u0398' to 0xC8, - '\u0399' to 0xC9, - '\u039A' to 0xCA, - '\u039B' to 0xCB, - '\u039C' to 0xCC, - '\u039D' to 0xCD, - '\u039E' to 0xCE, - '\u039F' to 0xCF, - '\u03A0' to 0xD0, - '\u03A1' to 0xD1, - '\uFFFD' to 0xD2, - '\u03A3' to 0xD3, - '\u03A4' to 0xD4, - '\u03A5' to 0xD5, - '\u03A6' to 0xD6, - '\u03A7' to 0xD7, - '\u03A8' to 0xD8, - '\u03A9' to 0xD9, - '\u03AA' to 0xDA, - '\u03AB' to 0xDB, - '\u03AC' to 0xDC, - '\u03AD' to 0xDD, - '\u03AE' to 0xDE, - '\u03AF' to 0xDF, - '\u03B0' to 0xE0, - '\u03B1' to 0xE1, - '\u03B2' to 0xE2, - '\u03B3' to 0xE3, - '\u03B4' to 0xE4, - '\u03B5' to 0xE5, - '\u03B6' to 0xE6, - '\u03B7' to 0xE7, - '\u03B8' to 0xE8, - '\u03B9' to 0xE9, - '\u03BA' to 0xEA, - '\u03BB' to 0xEB, - '\u03BC' to 0xEC, - '\u03BD' to 0xED, - '\u03BE' to 0xEE, - '\u03BF' to 0xEF, - '\u03C0' to 0xF0, - '\u03C1' to 0xF1, - '\u03C2' to 0xF2, - '\u03C3' to 0xF3, - '\u03C4' to 0xF4, - '\u03C5' to 0xF5, - '\u03C6' to 0xF6, - '\u03C7' to 0xF7, - '\u03C8' to 0xF8, - '\u03C9' to 0xF9, - '\u03CA' to 0xFA, - '\u03CB' to 0xFB, - '\u03CC' to 0xFC, - '\u03CD' to 0xFD, - '\u03CE' to 0xFE, - '\uFFFD' to 0xFF, - ) - } - /** Page 48 [Windows-1254] */ public data object Windows1254 : Charset(48, "windows-1254") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1253.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1253.kt new file mode 100644 index 0000000..9b149ef --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1253.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 47 [Windows-1253] */ +public data object Windows1253 : Charset(47, "windows-1253") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\uFFFD' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\uFFFD' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\uFFFD' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\u0385' to 0xA1, + '\u0386' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\uFFFD' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u2015' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u0384' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u0388' to 0xB8, + '\u0389' to 0xB9, + '\u038A' to 0xBA, + '\u00BB' to 0xBB, + '\u038C' to 0xBC, + '\u00BD' to 0xBD, + '\u038E' to 0xBE, + '\u038F' to 0xBF, + '\u0390' to 0xC0, + '\u0391' to 0xC1, + '\u0392' to 0xC2, + '\u0393' to 0xC3, + '\u0394' to 0xC4, + '\u0395' to 0xC5, + '\u0396' to 0xC6, + '\u0397' to 0xC7, + '\u0398' to 0xC8, + '\u0399' to 0xC9, + '\u039A' to 0xCA, + '\u039B' to 0xCB, + '\u039C' to 0xCC, + '\u039D' to 0xCD, + '\u039E' to 0xCE, + '\u039F' to 0xCF, + '\u03A0' to 0xD0, + '\u03A1' to 0xD1, + '\uFFFD' to 0xD2, + '\u03A3' to 0xD3, + '\u03A4' to 0xD4, + '\u03A5' to 0xD5, + '\u03A6' to 0xD6, + '\u03A7' to 0xD7, + '\u03A8' to 0xD8, + '\u03A9' to 0xD9, + '\u03AA' to 0xDA, + '\u03AB' to 0xDB, + '\u03AC' to 0xDC, + '\u03AD' to 0xDD, + '\u03AE' to 0xDE, + '\u03AF' to 0xDF, + '\u03B0' to 0xE0, + '\u03B1' to 0xE1, + '\u03B2' to 0xE2, + '\u03B3' to 0xE3, + '\u03B4' to 0xE4, + '\u03B5' to 0xE5, + '\u03B6' to 0xE6, + '\u03B7' to 0xE7, + '\u03B8' to 0xE8, + '\u03B9' to 0xE9, + '\u03BA' to 0xEA, + '\u03BB' to 0xEB, + '\u03BC' to 0xEC, + '\u03BD' to 0xED, + '\u03BE' to 0xEE, + '\u03BF' to 0xEF, + '\u03C0' to 0xF0, + '\u03C1' to 0xF1, + '\u03C2' to 0xF2, + '\u03C3' to 0xF3, + '\u03C4' to 0xF4, + '\u03C5' to 0xF5, + '\u03C6' to 0xF6, + '\u03C7' to 0xF7, + '\u03C8' to 0xF8, + '\u03C9' to 0xF9, + '\u03CA' to 0xFA, + '\u03CB' to 0xFB, + '\u03CC' to 0xFC, + '\u03CD' to 0xFD, + '\u03CE' to 0xFE, + '\uFFFD' to 0xFF, + ) +} From 26015d73338d41ce15de570a903fb1e8d2b618cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:40:44 +0200 Subject: [PATCH 29/34] Extract Windows1254 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1254.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1254.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 19de592..c6d5e59 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 48 [Windows-1254] */ - public data object Windows1254 : Charset(48, "windows-1254") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\u0192' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\u02C6' to 0x88, - '\u2030' to 0x89, - '\u0160' to 0x8A, - '\u2039' to 0x8B, - '\u0152' to 0x8C, - '\uFFFD' to 0x8D, - '\uFFFD' to 0x8E, - '\uFFFD' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\u02DC' to 0x98, - '\u2122' to 0x99, - '\u0161' to 0x9A, - '\u203A' to 0x9B, - '\u0153' to 0x9C, - '\uFFFD' to 0x9D, - '\uFFFD' to 0x9E, - '\u0178' to 0x9F, - '\u00A0' to 0xA0, - '\u00A1' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\u00A5' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u00AA' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00AF' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00B8' to 0xB8, - '\u00B9' to 0xB9, - '\u00BA' to 0xBA, - '\u00BB' to 0xBB, - '\u00BC' to 0xBC, - '\u00BD' to 0xBD, - '\u00BE' to 0xBE, - '\u00BF' to 0xBF, - '\u00C0' to 0xC0, - '\u00C1' to 0xC1, - '\u00C2' to 0xC2, - '\u00C3' to 0xC3, - '\u00C4' to 0xC4, - '\u00C5' to 0xC5, - '\u00C6' to 0xC6, - '\u00C7' to 0xC7, - '\u00C8' to 0xC8, - '\u00C9' to 0xC9, - '\u00CA' to 0xCA, - '\u00CB' to 0xCB, - '\u00CC' to 0xCC, - '\u00CD' to 0xCD, - '\u00CE' to 0xCE, - '\u00CF' to 0xCF, - '\u011E' to 0xD0, - '\u00D1' to 0xD1, - '\u00D2' to 0xD2, - '\u00D3' to 0xD3, - '\u00D4' to 0xD4, - '\u00D5' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u00D8' to 0xD8, - '\u00D9' to 0xD9, - '\u00DA' to 0xDA, - '\u00DB' to 0xDB, - '\u00DC' to 0xDC, - '\u0130' to 0xDD, - '\u015E' to 0xDE, - '\u00DF' to 0xDF, - '\u00E0' to 0xE0, - '\u00E1' to 0xE1, - '\u00E2' to 0xE2, - '\u00E3' to 0xE3, - '\u00E4' to 0xE4, - '\u00E5' to 0xE5, - '\u00E6' to 0xE6, - '\u00E7' to 0xE7, - '\u00E8' to 0xE8, - '\u00E9' to 0xE9, - '\u00EA' to 0xEA, - '\u00EB' to 0xEB, - '\u00EC' to 0xEC, - '\u00ED' to 0xED, - '\u00EE' to 0xEE, - '\u00EF' to 0xEF, - '\u011F' to 0xF0, - '\u00F1' to 0xF1, - '\u00F2' to 0xF2, - '\u00F3' to 0xF3, - '\u00F4' to 0xF4, - '\u00F5' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u00F8' to 0xF8, - '\u00F9' to 0xF9, - '\u00FA' to 0xFA, - '\u00FB' to 0xFB, - '\u00FC' to 0xFC, - '\u0131' to 0xFD, - '\u015F' to 0xFE, - '\u00FF' to 0xFF, - ) - } - /** Page 49 [Windows-1255] */ public data object Windows1255 : Charset(49, "windows-1255") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1254.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1254.kt new file mode 100644 index 0000000..71477dc --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1254.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 48 [Windows-1254] */ +public data object Windows1254 : Charset(48, "windows-1254") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\u0160' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\u0161' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\u0178' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u00C3' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u00CC' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u011E' to 0xD0, + '\u00D1' to 0xD1, + '\u00D2' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u0130' to 0xDD, + '\u015E' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u00E3' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u00EC' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u011F' to 0xF0, + '\u00F1' to 0xF1, + '\u00F2' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u0131' to 0xFD, + '\u015F' to 0xFE, + '\u00FF' to 0xFF, + ) +} From f4c5fb358f35d5a51d31198a41012032aa6afe5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:41:02 +0200 Subject: [PATCH 30/34] Extract Windows1255 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1255.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1255.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index c6d5e59..0f5472a 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 49 [Windows-1255] */ - public data object Windows1255 : Charset(49, "windows-1255") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\u0192' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\u02C6' to 0x88, - '\u2030' to 0x89, - '\uFFFD' to 0x8A, - '\u2039' to 0x8B, - '\uFFFD' to 0x8C, - '\uFFFD' to 0x8D, - '\uFFFD' to 0x8E, - '\uFFFD' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\u02DC' to 0x98, - '\u2122' to 0x99, - '\uFFFD' to 0x9A, - '\u203A' to 0x9B, - '\uFFFD' to 0x9C, - '\uFFFD' to 0x9D, - '\uFFFD' to 0x9E, - '\uFFFD' to 0x9F, - '\u00A0' to 0xA0, - '\u00A1' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u20AA' to 0xA4, - '\u00A5' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u00D7' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00AF' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00B8' to 0xB8, - '\u00B9' to 0xB9, - '\u00F7' to 0xBA, - '\u00BB' to 0xBB, - '\u00BC' to 0xBC, - '\u00BD' to 0xBD, - '\u00BE' to 0xBE, - '\u00BF' to 0xBF, - '\u05B0' to 0xC0, - '\u05B1' to 0xC1, - '\u05B2' to 0xC2, - '\u05B3' to 0xC3, - '\u05B4' to 0xC4, - '\u05B5' to 0xC5, - '\u05B6' to 0xC6, - '\u05B7' to 0xC7, - '\u05B8' to 0xC8, - '\u05B9' to 0xC9, - '\uFFFD' to 0xCA, - '\u05BB' to 0xCB, - '\u05BC' to 0xCC, - '\u05BD' to 0xCD, - '\u05BE' to 0xCE, - '\u05BF' to 0xCF, - '\u05C0' to 0xD0, - '\u05C1' to 0xD1, - '\u05C2' to 0xD2, - '\u05C3' to 0xD3, - '\u05F0' to 0xD4, - '\u05F1' to 0xD5, - '\u05F2' to 0xD6, - '\u05F3' to 0xD7, - '\u05F4' to 0xD8, - '\uFFFD' to 0xD9, - '\uFFFD' to 0xDA, - '\uFFFD' to 0xDB, - '\uFFFD' to 0xDC, - '\uFFFD' to 0xDD, - '\uFFFD' to 0xDE, - '\uFFFD' to 0xDF, - '\u05D0' to 0xE0, - '\u05D1' to 0xE1, - '\u05D2' to 0xE2, - '\u05D3' to 0xE3, - '\u05D4' to 0xE4, - '\u05D5' to 0xE5, - '\u05D6' to 0xE6, - '\u05D7' to 0xE7, - '\u05D8' to 0xE8, - '\u05D9' to 0xE9, - '\u05DA' to 0xEA, - '\u05DB' to 0xEB, - '\u05DC' to 0xEC, - '\u05DD' to 0xED, - '\u05DE' to 0xEE, - '\u05DF' to 0xEF, - '\u05E0' to 0xF0, - '\u05E1' to 0xF1, - '\u05E2' to 0xF2, - '\u05E3' to 0xF3, - '\u05E4' to 0xF4, - '\u05E5' to 0xF5, - '\u05E6' to 0xF6, - '\u05E7' to 0xF7, - '\u05E8' to 0xF8, - '\u05E9' to 0xF9, - '\u05EA' to 0xFA, - '\uFFFD' to 0xFB, - '\uFFFD' to 0xFC, - '\u200E' to 0xFD, - '\u200F' to 0xFE, - '\uFFFD' to 0xFF, - ) - } - /** Page 50 [Windows-1256] */ public data object Windows1256 : Charset(50, "windows-1256") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1255.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1255.kt new file mode 100644 index 0000000..a009ddb --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1255.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 49 [Windows-1255] */ +public data object Windows1255 : Charset(49, "windows-1255") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\uFFFD' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\uFFFD' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u20AA' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00D7' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00F7' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u05B0' to 0xC0, + '\u05B1' to 0xC1, + '\u05B2' to 0xC2, + '\u05B3' to 0xC3, + '\u05B4' to 0xC4, + '\u05B5' to 0xC5, + '\u05B6' to 0xC6, + '\u05B7' to 0xC7, + '\u05B8' to 0xC8, + '\u05B9' to 0xC9, + '\uFFFD' to 0xCA, + '\u05BB' to 0xCB, + '\u05BC' to 0xCC, + '\u05BD' to 0xCD, + '\u05BE' to 0xCE, + '\u05BF' to 0xCF, + '\u05C0' to 0xD0, + '\u05C1' to 0xD1, + '\u05C2' to 0xD2, + '\u05C3' to 0xD3, + '\u05F0' to 0xD4, + '\u05F1' to 0xD5, + '\u05F2' to 0xD6, + '\u05F3' to 0xD7, + '\u05F4' to 0xD8, + '\uFFFD' to 0xD9, + '\uFFFD' to 0xDA, + '\uFFFD' to 0xDB, + '\uFFFD' to 0xDC, + '\uFFFD' to 0xDD, + '\uFFFD' to 0xDE, + '\uFFFD' to 0xDF, + '\u05D0' to 0xE0, + '\u05D1' to 0xE1, + '\u05D2' to 0xE2, + '\u05D3' to 0xE3, + '\u05D4' to 0xE4, + '\u05D5' to 0xE5, + '\u05D6' to 0xE6, + '\u05D7' to 0xE7, + '\u05D8' to 0xE8, + '\u05D9' to 0xE9, + '\u05DA' to 0xEA, + '\u05DB' to 0xEB, + '\u05DC' to 0xEC, + '\u05DD' to 0xED, + '\u05DE' to 0xEE, + '\u05DF' to 0xEF, + '\u05E0' to 0xF0, + '\u05E1' to 0xF1, + '\u05E2' to 0xF2, + '\u05E3' to 0xF3, + '\u05E4' to 0xF4, + '\u05E5' to 0xF5, + '\u05E6' to 0xF6, + '\u05E7' to 0xF7, + '\u05E8' to 0xF8, + '\u05E9' to 0xF9, + '\u05EA' to 0xFA, + '\uFFFD' to 0xFB, + '\uFFFD' to 0xFC, + '\u200E' to 0xFD, + '\u200F' to 0xFE, + '\uFFFD' to 0xFF, + ) +} From d8bfd7a581ed165087ce05d35240f59b77c8ff2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:41:20 +0200 Subject: [PATCH 31/34] Extract Windows1256 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1256.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1256.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index 0f5472a..e659f70 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 50 [Windows-1256] */ - public data object Windows1256 : Charset(50, "windows-1256") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\u067E' to 0x81, - '\u201A' to 0x82, - '\u0192' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\u02C6' to 0x88, - '\u2030' to 0x89, - '\u0679' to 0x8A, - '\u2039' to 0x8B, - '\u0152' to 0x8C, - '\u0686' to 0x8D, - '\u0698' to 0x8E, - '\u0688' to 0x8F, - '\u06AF' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\u06A9' to 0x98, - '\u2122' to 0x99, - '\u0691' to 0x9A, - '\u203A' to 0x9B, - '\u0153' to 0x9C, - '\u200C' to 0x9D, - '\u200D' to 0x9E, - '\u06BA' to 0x9F, - '\u00A0' to 0xA0, - '\u060C' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\u00A5' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u06BE' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00AF' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00B8' to 0xB8, - '\u00B9' to 0xB9, - '\u061B' to 0xBA, - '\u00BB' to 0xBB, - '\u00BC' to 0xBC, - '\u00BD' to 0xBD, - '\u00BE' to 0xBE, - '\u061F' to 0xBF, - '\u06C1' to 0xC0, - '\u0621' to 0xC1, - '\u0622' to 0xC2, - '\u0623' to 0xC3, - '\u0624' to 0xC4, - '\u0625' to 0xC5, - '\u0626' to 0xC6, - '\u0627' to 0xC7, - '\u0628' to 0xC8, - '\u0629' to 0xC9, - '\u062A' to 0xCA, - '\u062B' to 0xCB, - '\u062C' to 0xCC, - '\u062D' to 0xCD, - '\u062E' to 0xCE, - '\u062F' to 0xCF, - '\u0630' to 0xD0, - '\u0631' to 0xD1, - '\u0632' to 0xD2, - '\u0633' to 0xD3, - '\u0634' to 0xD4, - '\u0635' to 0xD5, - '\u0636' to 0xD6, - '\u00D7' to 0xD7, - '\u0637' to 0xD8, - '\u0638' to 0xD9, - '\u0639' to 0xDA, - '\u063A' to 0xDB, - '\u0640' to 0xDC, - '\u0641' to 0xDD, - '\u0642' to 0xDE, - '\u0643' to 0xDF, - '\u00E0' to 0xE0, - '\u0644' to 0xE1, - '\u00E2' to 0xE2, - '\u0645' to 0xE3, - '\u0646' to 0xE4, - '\u0647' to 0xE5, - '\u0648' to 0xE6, - '\u00E7' to 0xE7, - '\u00E8' to 0xE8, - '\u00E9' to 0xE9, - '\u00EA' to 0xEA, - '\u00EB' to 0xEB, - '\u0649' to 0xEC, - '\u064A' to 0xED, - '\u00EE' to 0xEE, - '\u00EF' to 0xEF, - '\u064B' to 0xF0, - '\u064C' to 0xF1, - '\u064D' to 0xF2, - '\u064E' to 0xF3, - '\u00F4' to 0xF4, - '\u064F' to 0xF5, - '\u0650' to 0xF6, - '\u00F7' to 0xF7, - '\u0651' to 0xF8, - '\u00F9' to 0xF9, - '\u0652' to 0xFA, - '\u00FB' to 0xFB, - '\u00FC' to 0xFC, - '\u200E' to 0xFD, - '\u200F' to 0xFE, - '\u06D2' to 0xFF, - ) - } - /** Page 51 [Windows-1257] */ public data object Windows1257 : Charset(51, "windows-1257") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1256.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1256.kt new file mode 100644 index 0000000..0379f84 --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1256.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 50 [Windows-1256] */ +public data object Windows1256 : Charset(50, "windows-1256") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\u067E' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\u0679' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\u0686' to 0x8D, + '\u0698' to 0x8E, + '\u0688' to 0x8F, + '\u06AF' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u06A9' to 0x98, + '\u2122' to 0x99, + '\u0691' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\u200C' to 0x9D, + '\u200D' to 0x9E, + '\u06BA' to 0x9F, + '\u00A0' to 0xA0, + '\u060C' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u06BE' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u061B' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u061F' to 0xBF, + '\u06C1' to 0xC0, + '\u0621' to 0xC1, + '\u0622' to 0xC2, + '\u0623' to 0xC3, + '\u0624' to 0xC4, + '\u0625' to 0xC5, + '\u0626' to 0xC6, + '\u0627' to 0xC7, + '\u0628' to 0xC8, + '\u0629' to 0xC9, + '\u062A' to 0xCA, + '\u062B' to 0xCB, + '\u062C' to 0xCC, + '\u062D' to 0xCD, + '\u062E' to 0xCE, + '\u062F' to 0xCF, + '\u0630' to 0xD0, + '\u0631' to 0xD1, + '\u0632' to 0xD2, + '\u0633' to 0xD3, + '\u0634' to 0xD4, + '\u0635' to 0xD5, + '\u0636' to 0xD6, + '\u00D7' to 0xD7, + '\u0637' to 0xD8, + '\u0638' to 0xD9, + '\u0639' to 0xDA, + '\u063A' to 0xDB, + '\u0640' to 0xDC, + '\u0641' to 0xDD, + '\u0642' to 0xDE, + '\u0643' to 0xDF, + '\u00E0' to 0xE0, + '\u0644' to 0xE1, + '\u00E2' to 0xE2, + '\u0645' to 0xE3, + '\u0646' to 0xE4, + '\u0647' to 0xE5, + '\u0648' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u0649' to 0xEC, + '\u064A' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u064B' to 0xF0, + '\u064C' to 0xF1, + '\u064D' to 0xF2, + '\u064E' to 0xF3, + '\u00F4' to 0xF4, + '\u064F' to 0xF5, + '\u0650' to 0xF6, + '\u00F7' to 0xF7, + '\u0651' to 0xF8, + '\u00F9' to 0xF9, + '\u0652' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u200E' to 0xFD, + '\u200F' to 0xFE, + '\u06D2' to 0xFF, + ) +} From d4ce4e655ef8b8fae40e6deb487a51b071ef7a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:41:37 +0200 Subject: [PATCH 32/34] Extract Windows1257 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1257.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1257.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index e659f70..c012fc1 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 51 [Windows-1257] */ - public data object Windows1257 : Charset(51, "windows-1257") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\uFFFD' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\uFFFD' to 0x88, - '\u2030' to 0x89, - '\uFFFD' to 0x8A, - '\u2039' to 0x8B, - '\uFFFD' to 0x8C, - '\u00A8' to 0x8D, - '\u02C7' to 0x8E, - '\u00B8' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\uFFFD' to 0x98, - '\u2122' to 0x99, - '\uFFFD' to 0x9A, - '\u203A' to 0x9B, - '\uFFFD' to 0x9C, - '\u00AF' to 0x9D, - '\u02DB' to 0x9E, - '\uFFFD' to 0x9F, - '\u00A0' to 0xA0, - '\uFFFD' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\uFFFD' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00D8' to 0xA8, - '\u00A9' to 0xA9, - '\u0156' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00C6' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00F8' to 0xB8, - '\u00B9' to 0xB9, - '\u0157' to 0xBA, - '\u00BB' to 0xBB, - '\u00BC' to 0xBC, - '\u00BD' to 0xBD, - '\u00BE' to 0xBE, - '\u00E6' to 0xBF, - '\u0104' to 0xC0, - '\u012E' to 0xC1, - '\u0100' to 0xC2, - '\u0106' to 0xC3, - '\u00C4' to 0xC4, - '\u00C5' to 0xC5, - '\u0118' to 0xC6, - '\u0112' to 0xC7, - '\u010C' to 0xC8, - '\u00C9' to 0xC9, - '\u0179' to 0xCA, - '\u0116' to 0xCB, - '\u0122' to 0xCC, - '\u0136' to 0xCD, - '\u012A' to 0xCE, - '\u013B' to 0xCF, - '\u0160' to 0xD0, - '\u0143' to 0xD1, - '\u0145' to 0xD2, - '\u00D3' to 0xD3, - '\u014C' to 0xD4, - '\u00D5' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u0172' to 0xD8, - '\u0141' to 0xD9, - '\u015A' to 0xDA, - '\u016A' to 0xDB, - '\u00DC' to 0xDC, - '\u017B' to 0xDD, - '\u017D' to 0xDE, - '\u00DF' to 0xDF, - '\u0105' to 0xE0, - '\u012F' to 0xE1, - '\u0101' to 0xE2, - '\u0107' to 0xE3, - '\u00E4' to 0xE4, - '\u00E5' to 0xE5, - '\u0119' to 0xE6, - '\u0113' to 0xE7, - '\u010D' to 0xE8, - '\u00E9' to 0xE9, - '\u017A' to 0xEA, - '\u0117' to 0xEB, - '\u0123' to 0xEC, - '\u0137' to 0xED, - '\u012B' to 0xEE, - '\u013C' to 0xEF, - '\u0161' to 0xF0, - '\u0144' to 0xF1, - '\u0146' to 0xF2, - '\u00F3' to 0xF3, - '\u014D' to 0xF4, - '\u00F5' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u0173' to 0xF8, - '\u0142' to 0xF9, - '\u015B' to 0xFA, - '\u016B' to 0xFB, - '\u00FC' to 0xFC, - '\u017C' to 0xFD, - '\u017E' to 0xFE, - '\u02D9' to 0xFF, - ) - } - /** Page 52 [Windows-1258] */ public data object Windows1258 : Charset(52, "windows-1258") { override val mapping: Map = diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1257.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1257.kt new file mode 100644 index 0000000..b6e6d7a --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1257.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 51 [Windows-1257] */ +public data object Windows1257 : Charset(51, "windows-1257") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\uFFFD' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\uFFFD' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\uFFFD' to 0x8C, + '\u00A8' to 0x8D, + '\u02C7' to 0x8E, + '\u00B8' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\uFFFD' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\uFFFD' to 0x9C, + '\u00AF' to 0x9D, + '\u02DB' to 0x9E, + '\uFFFD' to 0x9F, + '\u00A0' to 0xA0, + '\uFFFD' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\uFFFD' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00D8' to 0xA8, + '\u00A9' to 0xA9, + '\u0156' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00C6' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00F8' to 0xB8, + '\u00B9' to 0xB9, + '\u0157' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00E6' to 0xBF, + '\u0104' to 0xC0, + '\u012E' to 0xC1, + '\u0100' to 0xC2, + '\u0106' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u0118' to 0xC6, + '\u0112' to 0xC7, + '\u010C' to 0xC8, + '\u00C9' to 0xC9, + '\u0179' to 0xCA, + '\u0116' to 0xCB, + '\u0122' to 0xCC, + '\u0136' to 0xCD, + '\u012A' to 0xCE, + '\u013B' to 0xCF, + '\u0160' to 0xD0, + '\u0143' to 0xD1, + '\u0145' to 0xD2, + '\u00D3' to 0xD3, + '\u014C' to 0xD4, + '\u00D5' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u0172' to 0xD8, + '\u0141' to 0xD9, + '\u015A' to 0xDA, + '\u016A' to 0xDB, + '\u00DC' to 0xDC, + '\u017B' to 0xDD, + '\u017D' to 0xDE, + '\u00DF' to 0xDF, + '\u0105' to 0xE0, + '\u012F' to 0xE1, + '\u0101' to 0xE2, + '\u0107' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u0119' to 0xE6, + '\u0113' to 0xE7, + '\u010D' to 0xE8, + '\u00E9' to 0xE9, + '\u017A' to 0xEA, + '\u0117' to 0xEB, + '\u0123' to 0xEC, + '\u0137' to 0xED, + '\u012B' to 0xEE, + '\u013C' to 0xEF, + '\u0161' to 0xF0, + '\u0144' to 0xF1, + '\u0146' to 0xF2, + '\u00F3' to 0xF3, + '\u014D' to 0xF4, + '\u00F5' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u0173' to 0xF8, + '\u0142' to 0xF9, + '\u015B' to 0xFA, + '\u016B' to 0xFB, + '\u00FC' to 0xFC, + '\u017C' to 0xFD, + '\u017E' to 0xFE, + '\u02D9' to 0xFF, + ) +} From 9c98cde147a44e9a24631bbec51ef4191ac81d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:41:57 +0200 Subject: [PATCH 33/34] Extract Windows1258 to its own file --- .../escpos4k/core/encoding/charset/Charset.kt | 135 ---------------- .../core/encoding/charset/Windows1258.kt | 152 ++++++++++++++++++ 2 files changed, 152 insertions(+), 135 deletions(-) create mode 100644 escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1258.kt diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt index c012fc1..64c5556 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Charset.kt @@ -100,141 +100,6 @@ public sealed class Charset( // /** Page 44 [CP1125: Ukrainian] */ // CP1125(44), - /** Page 52 [Windows-1258] */ - public data object Windows1258 : Charset(52, "windows-1258") { - override val mapping: Map = - mapOf( - '\u20AC' to 0x80, - '\uFFFD' to 0x81, - '\u201A' to 0x82, - '\u0192' to 0x83, - '\u201E' to 0x84, - '\u2026' to 0x85, - '\u2020' to 0x86, - '\u2021' to 0x87, - '\u02C6' to 0x88, - '\u2030' to 0x89, - '\uFFFD' to 0x8A, - '\u2039' to 0x8B, - '\u0152' to 0x8C, - '\uFFFD' to 0x8D, - '\uFFFD' to 0x8E, - '\uFFFD' to 0x8F, - '\uFFFD' to 0x90, - '\u2018' to 0x91, - '\u2019' to 0x92, - '\u201C' to 0x93, - '\u201D' to 0x94, - '\u2022' to 0x95, - '\u2013' to 0x96, - '\u2014' to 0x97, - '\u02DC' to 0x98, - '\u2122' to 0x99, - '\uFFFD' to 0x9A, - '\u203A' to 0x9B, - '\u0153' to 0x9C, - '\uFFFD' to 0x9D, - '\uFFFD' to 0x9E, - '\u0178' to 0x9F, - '\u00A0' to 0xA0, - '\u00A1' to 0xA1, - '\u00A2' to 0xA2, - '\u00A3' to 0xA3, - '\u00A4' to 0xA4, - '\u00A5' to 0xA5, - '\u00A6' to 0xA6, - '\u00A7' to 0xA7, - '\u00A8' to 0xA8, - '\u00A9' to 0xA9, - '\u00AA' to 0xAA, - '\u00AB' to 0xAB, - '\u00AC' to 0xAC, - '\u00AD' to 0xAD, - '\u00AE' to 0xAE, - '\u00AF' to 0xAF, - '\u00B0' to 0xB0, - '\u00B1' to 0xB1, - '\u00B2' to 0xB2, - '\u00B3' to 0xB3, - '\u00B4' to 0xB4, - '\u00B5' to 0xB5, - '\u00B6' to 0xB6, - '\u00B7' to 0xB7, - '\u00B8' to 0xB8, - '\u00B9' to 0xB9, - '\u00BA' to 0xBA, - '\u00BB' to 0xBB, - '\u00BC' to 0xBC, - '\u00BD' to 0xBD, - '\u00BE' to 0xBE, - '\u00BF' to 0xBF, - '\u00C0' to 0xC0, - '\u00C1' to 0xC1, - '\u00C2' to 0xC2, - '\u0102' to 0xC3, - '\u00C4' to 0xC4, - '\u00C5' to 0xC5, - '\u00C6' to 0xC6, - '\u00C7' to 0xC7, - '\u00C8' to 0xC8, - '\u00C9' to 0xC9, - '\u00CA' to 0xCA, - '\u00CB' to 0xCB, - '\u0300' to 0xCC, - '\u00CD' to 0xCD, - '\u00CE' to 0xCE, - '\u00CF' to 0xCF, - '\u0110' to 0xD0, - '\u00D1' to 0xD1, - '\u0309' to 0xD2, - '\u00D3' to 0xD3, - '\u00D4' to 0xD4, - '\u01A0' to 0xD5, - '\u00D6' to 0xD6, - '\u00D7' to 0xD7, - '\u00D8' to 0xD8, - '\u00D9' to 0xD9, - '\u00DA' to 0xDA, - '\u00DB' to 0xDB, - '\u00DC' to 0xDC, - '\u01AF' to 0xDD, - '\u0303' to 0xDE, - '\u00DF' to 0xDF, - '\u00E0' to 0xE0, - '\u00E1' to 0xE1, - '\u00E2' to 0xE2, - '\u0103' to 0xE3, - '\u00E4' to 0xE4, - '\u00E5' to 0xE5, - '\u00E6' to 0xE6, - '\u00E7' to 0xE7, - '\u00E8' to 0xE8, - '\u00E9' to 0xE9, - '\u00EA' to 0xEA, - '\u00EB' to 0xEB, - '\u0301' to 0xEC, - '\u00ED' to 0xED, - '\u00EE' to 0xEE, - '\u00EF' to 0xEF, - '\u0111' to 0xF0, - '\u00F1' to 0xF1, - '\u0323' to 0xF2, - '\u00F3' to 0xF3, - '\u00F4' to 0xF4, - '\u01A1' to 0xF5, - '\u00F6' to 0xF6, - '\u00F7' to 0xF7, - '\u00F8' to 0xF8, - '\u00F9' to 0xF9, - '\u00FA' to 0xFA, - '\u00FB' to 0xFB, - '\u00FC' to 0xFC, - '\u01B0' to 0xFD, - '\u20AB' to 0xFE, - '\u00FF' to 0xFF, - ) - } - // /** Page 53 [KZ-1048: Kazakhstan] */ // KZ1048(52, "KZ-1048"); diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1258.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1258.kt new file mode 100644 index 0000000..9e4dc2b --- /dev/null +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/Windows1258.kt @@ -0,0 +1,152 @@ +/* + * Copyright 2024 Ondřej Karmazín + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package cz.multiplatform.escpos4k.core.encoding.charset + +/** Page 52 [Windows-1258] */ +public data object Windows1258 : Charset(52, "windows-1258") { + override val mapping: Map = + mapOf( + '\u20AC' to 0x80, + '\uFFFD' to 0x81, + '\u201A' to 0x82, + '\u0192' to 0x83, + '\u201E' to 0x84, + '\u2026' to 0x85, + '\u2020' to 0x86, + '\u2021' to 0x87, + '\u02C6' to 0x88, + '\u2030' to 0x89, + '\uFFFD' to 0x8A, + '\u2039' to 0x8B, + '\u0152' to 0x8C, + '\uFFFD' to 0x8D, + '\uFFFD' to 0x8E, + '\uFFFD' to 0x8F, + '\uFFFD' to 0x90, + '\u2018' to 0x91, + '\u2019' to 0x92, + '\u201C' to 0x93, + '\u201D' to 0x94, + '\u2022' to 0x95, + '\u2013' to 0x96, + '\u2014' to 0x97, + '\u02DC' to 0x98, + '\u2122' to 0x99, + '\uFFFD' to 0x9A, + '\u203A' to 0x9B, + '\u0153' to 0x9C, + '\uFFFD' to 0x9D, + '\uFFFD' to 0x9E, + '\u0178' to 0x9F, + '\u00A0' to 0xA0, + '\u00A1' to 0xA1, + '\u00A2' to 0xA2, + '\u00A3' to 0xA3, + '\u00A4' to 0xA4, + '\u00A5' to 0xA5, + '\u00A6' to 0xA6, + '\u00A7' to 0xA7, + '\u00A8' to 0xA8, + '\u00A9' to 0xA9, + '\u00AA' to 0xAA, + '\u00AB' to 0xAB, + '\u00AC' to 0xAC, + '\u00AD' to 0xAD, + '\u00AE' to 0xAE, + '\u00AF' to 0xAF, + '\u00B0' to 0xB0, + '\u00B1' to 0xB1, + '\u00B2' to 0xB2, + '\u00B3' to 0xB3, + '\u00B4' to 0xB4, + '\u00B5' to 0xB5, + '\u00B6' to 0xB6, + '\u00B7' to 0xB7, + '\u00B8' to 0xB8, + '\u00B9' to 0xB9, + '\u00BA' to 0xBA, + '\u00BB' to 0xBB, + '\u00BC' to 0xBC, + '\u00BD' to 0xBD, + '\u00BE' to 0xBE, + '\u00BF' to 0xBF, + '\u00C0' to 0xC0, + '\u00C1' to 0xC1, + '\u00C2' to 0xC2, + '\u0102' to 0xC3, + '\u00C4' to 0xC4, + '\u00C5' to 0xC5, + '\u00C6' to 0xC6, + '\u00C7' to 0xC7, + '\u00C8' to 0xC8, + '\u00C9' to 0xC9, + '\u00CA' to 0xCA, + '\u00CB' to 0xCB, + '\u0300' to 0xCC, + '\u00CD' to 0xCD, + '\u00CE' to 0xCE, + '\u00CF' to 0xCF, + '\u0110' to 0xD0, + '\u00D1' to 0xD1, + '\u0309' to 0xD2, + '\u00D3' to 0xD3, + '\u00D4' to 0xD4, + '\u01A0' to 0xD5, + '\u00D6' to 0xD6, + '\u00D7' to 0xD7, + '\u00D8' to 0xD8, + '\u00D9' to 0xD9, + '\u00DA' to 0xDA, + '\u00DB' to 0xDB, + '\u00DC' to 0xDC, + '\u01AF' to 0xDD, + '\u0303' to 0xDE, + '\u00DF' to 0xDF, + '\u00E0' to 0xE0, + '\u00E1' to 0xE1, + '\u00E2' to 0xE2, + '\u0103' to 0xE3, + '\u00E4' to 0xE4, + '\u00E5' to 0xE5, + '\u00E6' to 0xE6, + '\u00E7' to 0xE7, + '\u00E8' to 0xE8, + '\u00E9' to 0xE9, + '\u00EA' to 0xEA, + '\u00EB' to 0xEB, + '\u0301' to 0xEC, + '\u00ED' to 0xED, + '\u00EE' to 0xEE, + '\u00EF' to 0xEF, + '\u0111' to 0xF0, + '\u00F1' to 0xF1, + '\u0323' to 0xF2, + '\u00F3' to 0xF3, + '\u00F4' to 0xF4, + '\u01A1' to 0xF5, + '\u00F6' to 0xF6, + '\u00F7' to 0xF7, + '\u00F8' to 0xF8, + '\u00F9' to 0xF9, + '\u00FA' to 0xFA, + '\u00FB' to 0xFB, + '\u00FC' to 0xFC, + '\u01B0' to 0xFD, + '\u20AB' to 0xFE, + '\u00FF' to 0xFF, + ) +} From 58210085e13a452937573a817c150a9671b5cabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Karmaz=C3=ADn?= Date: Wed, 18 Sep 2024 18:49:59 +0200 Subject: [PATCH 34/34] Rename the rest of CPxxx charsets to IBMxxx --- README.md | 4 ++-- .../cz/multiplatform/escpos4k/core/CommandBuilder.kt | 12 ++++++------ .../core/encoding/charset/{CP775.kt => IBM775.kt} | 2 +- .../core/encoding/charset/{CP852.kt => IBM852.kt} | 2 +- .../core/encoding/charset/{CP855.kt => IBM855.kt} | 2 +- .../core/encoding/charset/{CP857.kt => IBM857.kt} | 2 +- .../core/encoding/charset/{CP858.kt => IBM858.kt} | 2 +- .../core/encoding/charset/{CP860.kt => IBM860.kt} | 2 +- .../core/encoding/charset/{CP861.kt => IBM861.kt} | 2 +- .../core/encoding/charset/{CP862.kt => IBM862.kt} | 2 +- .../core/encoding/charset/{CP863.kt => IBM863.kt} | 2 +- .../core/encoding/charset/{CP864.kt => IBM864.kt} | 2 +- .../core/encoding/charset/{CP865.kt => IBM865.kt} | 2 +- .../core/encoding/charset/{CP866.kt => IBM866.kt} | 2 +- .../core/encoding/charset/{CP869.kt => IBM869.kt} | 2 +- 15 files changed, 21 insertions(+), 21 deletions(-) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP775.kt => IBM775.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP852.kt => IBM852.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP855.kt => IBM855.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP857.kt => IBM857.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP858.kt => IBM858.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP860.kt => IBM860.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP861.kt => IBM861.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP862.kt => IBM862.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP863.kt => IBM863.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP864.kt => IBM864.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP865.kt => IBM865.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP866.kt => IBM866.kt} (98%) rename escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/{CP869.kt => IBM869.kt} (98%) diff --git a/README.md b/README.md index d482d0e..be7f20d 100644 --- a/README.md +++ b/README.md @@ -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), diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt index 019c832..adcfd10 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/CommandBuilder.kt @@ -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 @@ -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") * } * ``` @@ -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") * } diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM775.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM775.kt index 2a2211f..e570214 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP775.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM775.kt @@ -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 = mapOf( '\u0106' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM852.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM852.kt index 96a836e..40fba48 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP852.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM852.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM855.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM855.kt index 1f8835f..d3beef9 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP855.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM855.kt @@ -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 = mapOf( '\u0452' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM857.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM857.kt index 122016f..9094672 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP857.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM857.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM858.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM858.kt index 53d24e6..ba33442 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP858.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM858.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM860.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM860.kt index 35f9fab..c084ec0 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP860.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM860.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM861.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM861.kt index df0fd08..958f811 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP861.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM861.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM862.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM862.kt index b3cc947..771fe71 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP862.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM862.kt @@ -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 = mapOf( '\u05D0' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM863.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM863.kt index 4a39360..f8fbcaa 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP863.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM863.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM864.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM864.kt index bfc727a..681b982 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP864.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM864.kt @@ -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 = mapOf( '\u00B0' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM865.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM865.kt index d00dfd6..d6efbee 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP865.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM865.kt @@ -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 = mapOf( '\u00C7' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM866.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM866.kt index ae3c90d..4610c37 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP866.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM866.kt @@ -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 = mapOf( '\u0410' to 0x80, diff --git a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM869.kt similarity index 98% rename from escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt rename to escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM869.kt index 908bcaf..11fc010 100644 --- a/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/CP869.kt +++ b/escpos4k/src/commonMain/kotlin/cz/multiplatform/escpos4k/core/encoding/charset/IBM869.kt @@ -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 = mapOf( '\uFFFD' to 0x80,