@@ -2017,23 +2017,23 @@ class LineComposer {
20172017
20182018const codepageMappings = {
20192019 'esc-pos' : {
2020- 'bixolon/legacy' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , , , , , , , , , , , , 'cp858' ] ,
2021- 'bixolon' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , , , , , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , , 'cp862' , 'cp864' , 'thai42' , 'windows1253' , 'windows1254' , 'windows1257' , , 'windows1251' , 'cp737' , 'cp775' , 'thai14' , 'bixolon/hebrew' , 'windows1255' , 'thai11' , 'thai18' , 'cp885' , 'cp857' , 'iso8859-7' , 'thai16' , 'windows1256' , 'windows1258' , 'khmer' , , , , 'bixolon/cp866' , 'windows1250' , , 'tcvn3' , 'tcvn3capitals' , 'viscii' ] ,
2022- 'citizen' : [ 'cp437' , 'epson/katakana' , 'cp858' , 'cp860' , 'cp863' , 'cp865' , 'cp852' , 'cp866' , 'cp857' , , , , , , , , 'windows1252' , , , , , 'thai11' , , , , , 'thai13' , , , , 'tcvn3' , 'tcvn3capitals' , 'windows1258' , , , , , , , , 'cp864' ] ,
2023- 'epson/legacy' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , , , , , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' ] ,
2024- 'epson' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , , , , 'cp851' , 'cp853' , 'cp857' , 'cp737' , 'iso8859-7' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'thai42' , 'thai11' , , , , , 'thai13' , , , , 'tcvn3' , 'tcvn3capitals' , 'cp720' , 'cp775' , 'cp855' , 'cp861' , 'cp862' , 'cp864' , 'cp869' , 'epson/iso8859-2' , 'iso8859-15' , 'cp1098' , 'cp774' , 'cp772' , 'cp1125' , 'windows1250' , 'windows1251' , 'windows1253' , 'windows1254' , 'windows1255' , 'windows1256' , 'windows1257' , 'windows1258' , 'rk1048' ] ,
2025- 'fujitsu' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , 'cp857' , , , , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , , , , , , , 'thai13' , , , , , , , , , , , , , , 'cp864' ] ,
2020+ 'bixolon/legacy' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'cp858' ] ,
2021+ 'bixolon' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'cp862' , 'cp864' , 'thai42' , 'windows1253' , 'windows1254' , 'windows1257' , 'windows1251' , 'cp737' , 'cp775' , 'thai14' , 'bixolon/hebrew' , 'windows1255' , 'thai11' , 'thai18' , 'cp885' , 'cp857' , 'iso8859-7' , 'thai16' , 'windows1256' , 'windows1258' , 'khmer' , 'bixolon/cp866' , 'windows1250' , 'tcvn3' , 'tcvn3capitals' , 'viscii' ] ,
2022+ 'citizen' : [ 'cp437' , 'epson/katakana' , 'cp858' , 'cp860' , 'cp863' , 'cp865' , 'cp852' , 'cp866' , 'cp857' , 'windows1252' , 'thai11' , 'thai13' , 'tcvn3' , 'tcvn3capitals' , 'windows1258' , 'cp864' ] ,
2023+ 'epson/legacy' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' ] ,
2024+ 'epson' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'cp851' , 'cp853' , 'cp857' , 'cp737' , 'iso8859-7' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'thai42' , 'thai11' , 'thai13' , 'tcvn3' , 'tcvn3capitals' , 'cp720' , 'cp775' , 'cp855' , 'cp861' , 'cp862' , 'cp864' , 'cp869' , 'epson/iso8859-2' , 'iso8859-15' , 'cp1098' , 'cp774' , 'cp772' , 'cp1125' , 'windows1250' , 'windows1251' , 'windows1253' , 'windows1254' , 'windows1255' , 'windows1256' , 'windows1257' , 'windows1258' , 'rk1048' ] ,
2025+ 'fujitsu' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'cp857' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'thai13' , 'cp864' ] ,
20262026 'hp' : [ 'cp437' , 'cp850' , 'cp852' , 'cp860' , 'cp863' , 'cp865' , 'cp858' , 'cp866' , 'windows1252' , 'cp862' , 'cp737' , 'cp874' , 'cp857' , 'windows1251' , 'windows1255' , 'rk1048' ] ,
2027- 'metapace' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , , , , , , , , , , , , 'cp858' ] ,
2028- 'mpt' : [ 'cp437' , , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1251' , 'cp866' , 'cp3021' , 'cp3012' ] ,
2029- 'pos-5890' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'iso8859-1' , , 'cp862' , , , , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , , , , 'windows1251' , 'cp737' , 'windows1257' , , 'windows1258' , 'cp864' , , , , 'windows1255' , , , , , , , , , , , , , , , , , , , , , , , , 'cp861' , , , , 'cp855' , 'cp857' , , , , 'cp851' , 'cp869' , , 'cp772' , 'cp774' , , , 'windows1250' , , 'cp3840' , , 'cp3843' , 'cp3844' , 'cp3845' , 'cp3846' , 'cp3847' , 'cp3848' , , 'cp771' , 'cp3001' , 'cp3002' , 'cp3011' , 'cp3012' , , 'cp3041' , 'windows1253' , 'windows1254' , 'windows1256' , 'cp720' , , 'cp775' ] ,
2030- 'pos-8360' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'iso8859-1' , 'windows1253' , 'cp862' , , , , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , , 'latvian' , , 'windows1251' , 'cp737' , 'windows1257' , , 'windows1258' , 'cp864' , , , 'pos8360/hebrew' , 'windows1255' , , , , , , , , , , , , , , , , , , , , , , , , 'cp861' , , , , 'cp855' , 'cp857' , , , , 'cp851' , 'cp869' , , 'cp772' , 'cp774' , , , 'windows1250' , , 'cp3840' , , 'cp3843' , 'cp3844' , 'cp3845' , 'cp3846' , 'cp3847' , 'cp3848' , , 'cp771' , 'cp3001' , 'cp3002' , 'cp3011' , 'cp3012' , , , , 'windows1254' , 'windows1256' , 'cp720' , , 'cp775' ] ,
2031- 'star' : [ 'cp437' , 'star/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , , , , , , , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'thai42' , 'thai11' , 'thai13' , 'thai14' , 'thai16' , , 'thai18' ] ,
2032- 'xprinter' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'iso8859-1' , 'windows1253' , 'xprinter/hebrew' , 'cp3012' , , 'windows1255' , , , , , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , , 'latvian' , 'cp864' , 'windows1251' , 'cp737' , 'windows1257' , , , , , , , , 'windows1256' ] ,
2033- 'youku' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1251' , 'cp866' , 'cp3021' , 'cp3012' , , , , , , 'cp862' , 'windows1252' , , 'cp852' , 'cp858' , , , 'cp864' , 'iso8859-1' , 'cp737' , 'windows1257' , , , 'cp855' , 'cp857' , 'windows1250' , 'cp775' , 'windows1254' , 'windows1255' , 'windows1256' , 'windows1258' , , , 'iso8859-1' , , , , , , 'iso8859-15' , , , 'cp874' ] ,
2027+ 'metapace' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'cp858' ] ,
2028+ 'mpt' : [ 'cp437' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1251' , 'cp866' , 'cp3021' , 'cp3012' ] ,
2029+ 'pos-5890' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'iso8859-1' , 'cp862' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'windows1251' , 'cp737' , 'windows1257' , 'windows1258' , 'cp864' , 'windows1255' , 'cp861' , 'cp855' , 'cp857' , 'cp851' , 'cp869' , 'cp772' , 'cp774' , 'windows1250' , 'cp3840' , 'cp3843' , 'cp3844' , 'cp3845' , 'cp3846' , 'cp3847' , 'cp3848' , 'cp771' , 'cp3001' , 'cp3002' , 'cp3011' , 'cp3012' , 'cp3041' , 'windows1253' , 'windows1254' , 'windows1256' , 'cp720' , 'cp775' ] ,
2030+ 'pos-8360' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'iso8859-1' , 'windows1253' , 'cp862' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'latvian' , 'windows1251' , 'cp737' , 'windows1257' , 'windows1258' , 'cp864' , 'pos8360/hebrew' , 'windows1255' , 'cp861' , 'cp855' , 'cp857' , 'cp851' , 'cp869' , 'cp772' , 'cp774' , 'windows1250' , 'cp3840' , 'cp3843' , 'cp3844' , 'cp3845' , 'cp3846' , 'cp3847' , 'cp3848' , 'cp771' , 'cp3001' , 'cp3002' , 'cp3011' , 'cp3012' , 'windows1254' , 'windows1256' , 'cp720' , 'cp775' ] ,
2031+ 'star' : [ 'cp437' , 'star/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'thai42' , 'thai11' , 'thai13' , 'thai14' , 'thai16' , 'thai18' ] ,
2032+ 'xprinter' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'iso8859-1' , 'windows1253' , 'xprinter/hebrew' , 'cp3012' , 'windows1255' , 'windows1252' , 'cp866' , 'cp852' , 'cp858' , 'latvian' , 'cp864' , 'windows1251' , 'cp737' , 'windows1257' , 'windows1256' ] ,
2033+ 'youku' : [ 'cp437' , 'epson/katakana' , 'cp850' , 'cp860' , 'cp863' , 'cp865' , 'windows1251' , 'cp866' , 'cp3021' , 'cp3012' , 'cp862' , 'windows1252' , 'cp852' , 'cp858' , 'cp864' , 'iso8859-1' , 'cp737' , 'windows1257' , 'cp855' , 'cp857' , 'windows1250' , 'cp775' , 'windows1254' , 'windows1255' , 'windows1256' , 'windows1258' , 'iso8859-1' , 'iso8859-15' , 'cp874' ] ,
20342034 } ,
20352035 'star-prnt' : {
2036- 'star' : [ 'star/standard' , 'cp437' , 'star/katakana' , , 'cp858' , 'cp852' , 'cp860' , 'cp861' , 'cp863' , 'cp865' , 'cp866' , 'cp855' , 'cp857' , 'cp862' , 'cp864' , 'cp737' , 'cp851' , 'cp869' , 'star/cp928' , 'cp772' , 'cp774' , 'star/cp874' , , , , , , , , , , , 'windows1252' , 'windows1250' , 'windows1251' , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 'cp3840' , 'cp3841' , 'cp3843' , 'cp3844' , 'cp3845' , 'cp3846' , 'cp3847' , 'cp3848' , 'cp1001' , 'cp771' , 'cp3001' , 'cp3002' , 'cp3011' , 'cp3012' , 'cp3021' , 'cp3041' ] ,
2036+ 'star' : [ 'star/standard' , 'cp437' , 'star/katakana' , 'cp858' , 'cp852' , 'cp860' , 'cp861' , 'cp863' , 'cp865' , 'cp866' , 'cp855' , 'cp857' , 'cp862' , 'cp864' , 'cp737' , 'cp851' , 'cp869' , 'star/cp928' , 'cp772' , 'cp774' , 'star/cp874' , 'windows1252' , 'windows1250' , 'windows1251' , 'cp3840' , 'cp3841' , 'cp3843' , 'cp3844' , 'cp3845' , 'cp3846' , 'cp3847' , 'cp3848' , 'cp1001' , 'cp771' , 'cp3001' , 'cp3002' , 'cp3011' , 'cp3012' , 'cp3021' , 'cp3041' ] ,
20372037 }
20382038} ;
20392039
@@ -2223,9 +2223,10 @@ class ReceiptPrinterEncoder {
22232223 throw new Error ( 'Unknown codepage mapping' ) ;
22242224 }
22252225
2226- this . #codepageMapping = Object . fromEntries ( codepageMappings [ this . #options. language ] [ this . #options. codepageMapping ]
2227- . map ( ( v , i ) => [ v , i ] )
2228- . filter ( ( i ) => i ) ) ;
2226+ this . #codepageMapping = Object . fromEntries (
2227+ Object . entries ( codepageMappings [ this . #options. language ] [ this . #options. codepageMapping ] )
2228+ . map ( ( [ key , value ] ) => [ value , parseInt ( key ) ] )
2229+ ) ;
22292230 } else {
22302231 this . #codepageMapping = this . #options. codepageMapping ;
22312232 }
0 commit comments