commit a5e08510f07fd905f02bc83a3723bc6655c6378d Author: Eduardo Silva Date: Thu May 2 21:19:44 2024 +0100 First actual commit diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/cmd/message.go b/cmd/message.go new file mode 100644 index 0000000..0d8328a --- /dev/null +++ b/cmd/message.go @@ -0,0 +1,33 @@ +/* +Copyright © 2024 NAME HERE +*/ +package cmd + +import ( + thermalprinter "thermalPrinter/thermalPrinter" + + "github.com/spf13/cobra" +) + +func messageCmdAction(cmd *cobra.Command, args []string) { + message, _ := cmd.Flags().GetString("message") + + printer := thermalprinter.GetInstance(nil) + + printer.Print(message) +} + +// messageCmd represents the message command +var messageCmd = &cobra.Command{ + Use: "message", + Short: "", + Long: ``, + Run: messageCmdAction, +} + +func init() { + rootCmd.AddCommand(messageCmd) + + messageCmd.Flags().StringP("message", "m", "Hello, world!\n", "Message to print") + messageCmd.MarkFlagRequired("message") +} diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 0000000..046f692 --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,61 @@ +/* +Copyright © 2024 NAME HERE +*/ +package cmd + +import ( + "bufio" + "fmt" + "os" + thermalprinter "thermalPrinter/thermalPrinter" + + "github.com/spf13/cobra" +) + +func rootCmdAction(cmd *cobra.Command, args []string) { + scanner := bufio.NewScanner(os.Stdin) + fmt.Print("Enter text: ") + + // Scan until EOF (Ctrl+D) + text := "" + // Should refactor this weird looking thing + for scanner.Scan() { + text += scanner.Text() + "\n" + } + + if err := scanner.Err(); err != nil { + fmt.Println("Error:", err) + } + + printer := thermalprinter.GetInstance(nil) + printer.Print(text) +} + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: "thermalPrinter", + Short: "", + Long: ``, + Run: rootCmdAction, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + err := rootCmd.Execute() + if err != nil { + os.Exit(1) + } +} + +func init() { + // Here you will define your flags and configuration settings. + // Cobra supports persistent flags, which, if defined here, + // will be global for your application. + + /* rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.thermalPrinter.yaml)") */ + + // Cobra also supports local flags, which will only run + // when this action is called directly. + /* rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") */ +} diff --git a/code_pages/analyze_tables.py b/code_pages/analyze_tables.py new file mode 100755 index 0000000..0d9641b --- /dev/null +++ b/code_pages/analyze_tables.py @@ -0,0 +1,45 @@ +#!/bin/env python + + +import os + + +def get_tables(dir_path): + txt_files = [] + for f in os.listdir(dir_path): + if f.endswith("1255.txt"): + txt_files.append(f) + + return txt_files + + +def debug(d): + hex = ":".join("{:02x}".format(ord(c)) for c in d[1]) + # if hex == 0x5b0: + print(hex, d) + + +def main(): + dir = "./" + charset = {} + for f in get_tables(dir): + with open(dir + f, "r") as data: + for line in data.readlines(): + d = line.strip('\n').split(' ') + + debug(d) + + if len(d) < 2: + continue + + if d[1] in charset: + charset[d[1]].append(f) + else: + charset[d[1]] = [f] + + # for k in charset: + # print(k, ":".join("{:02x}".format(ord(c)) for c in k), charset[k]) + + +if __name__ == "__main__": + main() diff --git a/code_pages/cp1098.html b/code_pages/cp1098.html new file mode 100644 index 0000000..1351386 --- /dev/null +++ b/code_pages/cp1098.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 1098[3][4][5] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x + + +، +؛ +؟ +ً +ﺁ +ﺂ + +ﺍ +ﺎ + +ﺀ +ﺃ +ﺄ + +
9x +ﺅ +ﺋ +ﺏ +ﺑ +ﭖ +ﭘ +ﺕ +ﺗ +ﺙ +ﺛ +ﺝ +ﺟ +ﭺ +ﭼ +× +ﺡ +
Ax +ﺣ +ﺥ +ﺧ +ﺩ +ﺫ +ﺭ +ﺯ +ﮊ +ﺱ +ﺳ +ﺵ +ﺷ +ﺹ +ﺻ +« +» +
Bx +░ +▒ +▓ +│ +┤ +ﺽ +ﺿ +ﻁ +ﻃ +╣ +║ +╗ +╝ +﷼[a] +ﻅ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +ﻇ +ﻉ +╚ +╔ +╩ +╦ +╠ +═ +╬ + +
Dx +ﻊ +ﻋ +ﻌ +ﻍ +ﻎ +ﻏ +ﻐ +ﻑ +ﻓ +┘ +┌ +█ +▄ +ﻕ +ﻗ +▀ +
Ex +ﮎ +ﻛ +ﮒ +ﮔ +ﻝ +ﻟ +ﻡ +ﻣ +ﻥ +ﻧ +ﻭ +ﻩ +ﻫ +ﻬ +ﮤ +ﯼ +
Fx +SHY +ﯽ +ﯾ +ـ +۰ +۱ +۲ +۳ +۴ +۵ +۶ +۷ +۸ +۹ +■ +NBSP +
diff --git a/code_pages/cp1118.html b/code_pages/cp1118.html new file mode 100644 index 0000000..1bdbef7 --- /dev/null +++ b/code_pages/cp1118.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 774/1118[2][3] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +à +å +ç +ê +ë +è +ï +î +ì +Ä +Å +
9x +É +æ +Æ +ô +ö +ò +û +ù +ÿ +Ö +Ü +¢ +£ +¥ +₧ +ƒ +
Ax +á +í +ó +ú +ñ +Ñ +ª +º +¿ +⌐ +¬ +½ +¼ +¡ +« +» +
Bx +░ +▒ +▓ +│ +┤ +Ą +Č +Ę +Ė +╣ +║ +╗ +╝ +Į +Š +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +Ų +Ū +╚ +╔ +╩ +╦ +╠ +═ +╬ +Ž +
Dx +ą +č +ę +ė +į +š +ų +ū +ž +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +α +ß +Γ +π +Σ +σ +µ +τ +Φ +Θ +Ω +δ +∞ +φ +ε +∩ +
Fx +≡ +± +≥ +≤ +„ +“ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp1119.html b/code_pages/cp1119.html new file mode 100644 index 0000000..21966ae --- /dev/null +++ b/code_pages/cp1119.html @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LST 1284:1993 (Code page 772 / 1119)[23][24] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
Bx +░
2591 +
▒
2592 +
▓
2593 +
│
2502 +
┤
2524 +
Ą
0104 +
Č
010C +
Ę
0118 +
Ė
0116 +
╣
2563 +
║
2551 +
╗
2557 +
╝
255D +
Į
012E +
Š
0160 +
┐
2510 +
Cx +└
2514 +
┴
2534 +
┬
252C +
├
251C +
─
2500 +
┼
253C +
Ų
0172 +
Ū
016A +
╚
255A +
╔
2554 +
╩
2569 +
╦
2566 +
╠
2560 +
═
2550 +
╬
256C +
Ž
017D +
Dx +ą
0105 +
č
010D +
ę
0119 +
ė
0117 +
į
012F +
š
0161 +
ų
0173 +
ū
016B +
ž
017E +
┘
2518 +
┌
250C +
█
2588 +
▄
2584 +
▌
258C +
▐
2590 +
▀
2580 +
Ex +р
0440 +
с
0441 +
т
0442 +
у
0443 +
ф
0444 +
х
0445 +
ц
0446 +
ч
0447 +
ш
0448 +
щ
0449 +
ъ
044A +
ы
044B +
ь
044C +
э
044D +
ю
044E +
я
044F +
Fx +Ё
0401 +
ё
0451 +
≥
2265 +
≤
2264 +
„
201E +
“
201C +
÷
00F7 +
≈
2248 +
°
00B0 +
∙
2219 +
·
00B7 +
√
221A +
ⁿ
207F +
²
00B2 +
■
25A0 +
NBSP
00A0 +
diff --git a/code_pages/cp437.html b/code_pages/cp437.html new file mode 100644 index 0000000..d04f935 --- /dev/null +++ b/code_pages/cp437.html @@ -0,0 +1,854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 437[11][12][13][14] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x
0 +
NUL[a] +☺
263A +
☻
263B +
♥
2665 +
♦
2666 +
♣
2663 +
♠
2660 +
•
2022 +
◘
25D8 +
○
25CB +
◙
25D9 +
♂
2642 +
♀
2640 +
♪
266A +
♫[b]
266B +
☼
263C +
1x
16 +
►
25BA +
◄
25C4 +
↕
2195 +
‼
203C +

00B6 +
§
00A7 +
▬
25AC +
↨
21A8 +
↑
2191 +
↓
2193 +
→
2192 +
←
2190 +
∟
221F +
↔
2194 +
▲
25B2 +
▼
25BC +
2x
32 +
 SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x
48 +
0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x
64 +
@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x
80 +
P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x
96 +
` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x
112 +
p +q +r +s +t +u +v +w +x +y +z +{ +|[c] +} +~ +⌂[d]
2302 +
8x
128 +
Ç
00C7 +
ü
00FC +
é
00E9 +
â
00E2 +
ä
00E4 +
à
00E0 +
å
00E5 +
ç
00E7 +
ê
00EA +
ë
00EB +
è
00E8 +
ï
00EF +
î
00EE +
ì
00EC +
Ä
00C4 +
Å
00C5 +
9x
144 +
É
00C9 +
æ
00E6 +
Æ
00C6 +
ô
00F4 +
ö
00F6 +
ò
00F2 +
û
00FB +
ù
00F9 +
ÿ
00FF +
Ö
00D6 +
Ü
00DC +
¢
00A2 +
£
00A3 +
¥
00A5 +
₧
20A7 +
ƒ
0192 +
Ax
160 +
á
00E1 +
í
00ED +
ó
00F3 +
ú
00FA +
ñ
00F1 +
Ñ
00D1 +
ª
00AA +
º
00BA +
¿
00BF +
⌐
2310 +
¬
00AC +
½
00BD +
¼
00BC +
¡
00A1 +
«
00AB +
»
00BB +
Bx
176 +
░
2591 +
▒
2592 +
▓
2593 +
│[e]
2502 +
┤
2524 +
╡
2561 +
╢
2562 +
╖
2556 +
╕
2555 +
╣
2563 +
║
2551 +
╗
2557 +
╝
255D +
╜
255C +
╛
255B +
┐
2510 +
Cx
192 +
└
2514 +
┴
2534 +
┬
252C +
├
251C +
─
2500 +
┼
253C +
╞
255E +
╟
255F +
╚
255A +
╔
2554 +
╩
2569 +
╦
2566 +
╠
2560 +
═
2550 +
╬
256C +
╧
2567 +
Dx
208 +
╨
2568 +
╤
2564 +
╥
2565 +
╙
2559 +
╘
2558 +
╒
2552 +
╓
2553 +
╫
256B +
╪
256A +
┘
2518 +
┌
250C +
█
2588 +
▄
2584 +
▌
258C +
▐
2590 +
▀
2580 +
Ex
224 +
α
03B1 +
ß[f]
00DF +
Γ
0393 +
π[g]
03C0 +
Σ[h]
03A3 +
σ
03C3 +
µ[i]
00B5 +
τ
03C4 +
Φ
03A6 +
Θ[j]
0398 +
Ω[k]
03A9 +
δ[l]
03B4 +
∞
221E +
φ[m]
03C6 +
ε[n]
03B5 +
∩
2229 +
Fx
240 +
≡
2261 +
±
00B1 +
≥
2265 +
≤
2264 +
⌠[o]
2320 +
⌡
2321 +
÷
00F7 +
≈
2248 +
°
00B0 +
∙[p]
2219 +
·
00B7 +
√[q]
221A +
ⁿ
207F +
²
00B2 +
■
25A0 +
NBSP[r]
00A0 +
diff --git a/code_pages/cp720.html b/code_pages/cp720.html new file mode 100644 index 0000000..310c0fe --- /dev/null +++ b/code_pages/cp720.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 720[4][5][6] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x + + +é +â + +à + +ç +ê +ë +è +ï +î + + + +
9x + +_ّ +_ْ +ô +¤ +ـ +û +ù +ء +آ +أ +ؤ +£ +إ +ئ +ا +
Ax +ب +ة +ت +ث +ج +ح +خ +د +ذ +ر +ز +س +ش +ص +« +» +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +ض +ط +ظ +ع +غ +ف +µ +ق +ك +ل +م +ن +ه +و +ى +ي +
Fx +≡ +_ً +_ٌ +_ٍ +_َ +_ُ +_ِ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp737.html b/code_pages/cp737.html new file mode 100644 index 0000000..8cb1122 --- /dev/null +++ b/code_pages/cp737.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 737[2][5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Α +Β +Γ +Δ +Ε +Ζ +Η +Θ +Ι +Κ +Λ +Μ +Ν +Ξ +Ο +Π +
9x +Ρ +Σ +Τ +Υ +Φ +Χ +Ψ +Ω +α +β +γ +δ +ε +ζ +η +θ +
Ax +ι +κ +λ +μ +ν +ξ +ο +π +ρ +σ +ς +τ +υ +φ +χ +ψ +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +ω +ά +έ +ή +ϊ +ί +ό +ύ +ϋ +ώ +Ά +Έ +Ή +Ί +Ό +Ύ +
Fx +Ώ +± +≥ +≤ +Ϊ +Ϋ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp775.html b/code_pages/cp775.html new file mode 100644 index 0000000..c368272 --- /dev/null +++ b/code_pages/cp775.html @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 775[3][8][9][10][11] +
+01234 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ć +ü +é +ā +ä +ģ +å +ć +ł +ē +Ŗ +ŗ +ī +Ź +Ä +Å +
9x +É +æ +Æ +ō +ö +Ģ +¢ +Ś +ś +Ö +Ü +ø +£ +Ø +× +¤ +
Ax +Ā +Ī +ó +Ż +ż +ź +” +¦ +© +® +¬ +½ +¼ +Ł +« +» +
Bx +░ +▒ +▓ +│ +┤ +Ą +Č +Ę +Ė +╣ +║ +╗ +╝ +Į +Š +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +Ų +Ū +╚ +╔ +╩ +╦ +╠ +═ +╬ +Ž +
Dx +ą +č +ę +ė +į +š +ų +ū +ž +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +Ó +ß +Ō +Ń +õ +Õ +µ +ń +Ķ +ķ +Ļ +ļ +ņ +Ē +Ņ +’ +
Fx +SHY +± +“ +¾ + +§ +÷ +„ +° +∙ +· +¹ +³ +² +■ +NBSP +
diff --git a/code_pages/cp850.html b/code_pages/cp850.html new file mode 100644 index 0000000..1777070 --- /dev/null +++ b/code_pages/cp850.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 850[3][7][8][9][10] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +☺
263A +
☻
263B +
♥
2665 +
♦
2666 +
♣
2663 +
♠
2660 +
•
2022 +
◘
25D8 +
○
25CB +
◙
25D9 +
♂
2642 +
♀
2640 +
♪
266A +
♫
266B +
☼
263C +
1x +►
25BA +
◄
25C4 +
↕
2195 +
‼
203C +

00B6 +
§
00A7 +
▬
25AC +
↨
21A8 +
↑
2191 +
↓
2193 +
→
2192 +
←
2190 +
∟
221F +
↔
2194 +
▲
25B2 +
▼
25BC +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +⌂
2302 +
8x +Ç
00C7 +
ü
00FC +
é
00E9 +
â
00E2 +
ä
00E4 +
à
00E0 +
å
00E5 +
ç
00E7 +
ê
00EA +
ë
00EB +
è
00E8 +
ï
00EF +
î
00EE +
ì
00EC +
Ä
00C4 +
Å
00C5 +
9x +É
00C9 +
æ
00E6 +
Æ
00C6 +
ô
00F4 +
ö
00F6 +
ò
00F2 +
û
00FB +
ù
00F9 +
ÿ
00FF +
Ö
00D6 +
Ü
00DC +
ø
00F8 +
£
00A3 +
Ø
00D8 +
×
00D7 +
ƒ
0192 +
Ax +á
00E1 +
í
00ED +
ó
00F3 +
ú
00FA +
ñ
00F1 +
Ñ
00D1 +
ª
00AA +
º
00BA +
¿
00BF +
®
00AE +
¬
00AC +
½
00BD +
¼
00BC +
¡
00A1 +
«
00AB +
»
00BB +
Bx +░
2591 +
▒
2592 +
▓
2593 +
│
2502 +
┤
2524 +
Á
00C1 +
Â
00C2 +
À
00C0 +
©
00A9 +
╣
2563 +
║
2551 +
╗
2557 +
╝
255D +
¢
00A2 +
¥
00A5 +
┐
2510 +
Cx +└
2514 +
┴
2534 +
┬
252C +
├
251C +
─
2500 +
┼
253C +
ã
00E3 +
Ã
00C3 +
╚
255A +
╔
2554 +
╩
2569 +
╦
2566 +
╠
2560 +
═
2550 +
╬
256C +
¤
00A4 +
Dx +ð
00F0 +
Ð
00D0 +
Ê
00CA +
Ë
00CB +
È
00C8 +
ı
0131 +
Í
00CD +
Î
00CE +
Ï
00CF +
┘
2518 +
┌
250C +
█
2588 +
▄
2584 +
¦
00A6 +
Ì
00CC +
▀
2580 +
Ex +Ó
00D3 +
ß
00DF +
Ô
00D4 +
Ò
00D2 +
õ
00F5 +
Õ
00D5 +
µ
00B5 +
þ
00FE +
Þ
00DE +
Ú
00DA +
Û
00DB +
Ù
00D9 +
ý
00FD +
Ý
00DD +
¯
00AF +
´
00B4 +
Fx +SHY
00AD +
±
00B1 +
‗
2017 +
¾
00BE +

00B6 +
§
00A7 +
÷
00F7 +
¸
00B8 +
°
00B0 +
¨
00A8 +
·
00B7 +
¹
00B9 +
³
00B3 +
²
00B2 +
■
25A0 +
NBSP
00A0 +
diff --git a/code_pages/cp851.html b/code_pages/cp851.html new file mode 100644 index 0000000..d7fc4cd --- /dev/null +++ b/code_pages/cp851.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 851[3][4][5][6] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +à +Ά +ç +ê +ë +è +ï +î +Έ +Ä +Ή +
9x +Ί + +Ό +ô +ö +Ύ +û +ù +Ώ +Ö +Ü +ά +£ +έ +ή +ί +
Ax +ϊ +ΐ +ό +ύ +Α +Β +Γ +Δ +Ε +Ζ +Η +½ +Θ +Ι +« +» +
Bx +░ +▒ +▓ +│ +┤ +Κ +Λ +Μ +Ν +╣ +║ +╗ +╝ +Ξ +Ο +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +Π +Ρ +╚ +╔ +╩ +╦ +╠ +═ +╬ +Σ +
Dx +Τ +Υ +Φ +Χ +Ψ +Ω +α +β +γ +┘ +┌ +█ +▄ +δ +ε +▀ +
Ex +ζ +η +θ +ι +κ +λ +μ +ν +ξ +ο +π +ρ +σ +ς +τ +´ +
Fx +SHY +± +υ +φ +χ +§ +ψ +¸ +° +¨ +ω +ϋ +ΰ +ώ +■ +NBSP +
diff --git a/code_pages/cp852.html b/code_pages/cp852.html new file mode 100644 index 0000000..da1f52c --- /dev/null +++ b/code_pages/cp852.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 852[4][7][8][12] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +ů +ć +ç +ł +ë +Ő +ő +î +Ź +Ä +Ć +
9x +É +Ĺ +ĺ +ô +ö +Ľ +ľ +Ś +ś +Ö +Ü +Ť +ť +Ł +× +č +
Ax +á +í +ó +ú +Ą +ą +Ž +ž +Ę +ę +¬ +ź +Č +ş +« +» +
Bx +░ +▒ +▓ +│ +┤ +Á +Â +Ě +Ş +╣ +║ +╗ +╝ +Ż +ż +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +Ă +ă +╚ +╔ +╩ +╦ +╠ +═ +╬ +¤ +
Dx +đ +Đ +Ď +Ë +ď +Ň +Í +Î +ě +┘ +┌ +█ +▄ +Ţ +Ů +▀ +
Ex +Ó +ß +Ô +Ń +ń +ň +Š +š +Ŕ +Ú +ŕ +Ű +ý +Ý +ţ +´ +
Fx +SHY +˝ +˛ +ˇ +˘ +§ +÷ +¸ +° +¨ +˙ +ű +Ř +ř +■ +NBSP +
diff --git a/code_pages/cp853.html b/code_pages/cp853.html new file mode 100644 index 0000000..89429a7 --- /dev/null +++ b/code_pages/cp853.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 853[2][3] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +à +ĉ +ç +ê +ë +è +ï +î +ì +Ä +Ĉ +
9x +É +ċ +Ċ +ô +ö +ò +û +ù +İ +Ö +Ü +ĝ +£ +Ĝ +× +ĵ +
Ax +á +í +ó +ú +ñ +Ñ +Ğ +ğ +Ĥ +ĥ + +½ +Ĵ +ş +« +» +
Bx +░ +▒ +▓ +│ +┤ +Á +Â +À +Ş +╣ +║ +╗ +╝ +Ż +ż +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +Ŝ +ŝ +╚ +╔ +╩ +╦ +╠ +═ +╬ +¤ +
Dx + + +Ê +Ë +È +ı +Í +Î +Ï +┘ +┌ +█ +▄ + +Ì +▀ +
Ex +Ó +ß +Ô +Ò +Ġ +ġ +µ +Ħ +ħ +Ú +Û +Ù +Ŭ +ŭ +· +´ +
Fx +SHY + +ℓ +ʼn +˘ +§ +÷ +¸ +° +¨ +˙ + +³ +² +■ +NBSP +
diff --git a/code_pages/cp855.html b/code_pages/cp855.html new file mode 100644 index 0000000..4295c82 --- /dev/null +++ b/code_pages/cp855.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 855[7][8][9][10][11] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +☺ +☻ +♥ +♦ +♣ +♠ +• +◘ +○ +◙ +♂ +♀ +♪ +♫ +☼ +
1x +► +◄ +↕ +‼ + +§ +▬ +↨ +↑ +↓ +→ +← +∟ +↔ +▲ +▼ +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +⌂ +
8x +ђ +Ђ +ѓ +Ѓ +ё +Ё +є +Є +ѕ +Ѕ +і +І +ї +Ї +ј +Ј +
9x +љ +Љ +њ +Њ +ћ +Ћ +ќ +Ќ +ў +Ў +џ +Џ +ю +Ю +ъ +Ъ +
Ax +а +А +б +Б +ц +Ц +д +Д +е +Е +ф +Ф +г +Г +« +» +
Bx +░ +▒ +▓ +│ +┤ +х +Х +и +И +╣ +║ +╗ +╝ +й +Й +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +к +К +╚ +╔ +╩ +╦ +╠ +═ +╬ +¤ +
Dx +л +Л +м +М +н +Н +о +О +п +┘ +┌ +█ +▄ +П +я +▀ +
Ex +Я +р +Р +с +С +т +Т +у +У +ж +Ж +в +В +ь +Ь +№ +
Fx +SHY +ы +Ы +з +З +ш +Ш +э +Э +щ +Щ +ч +Ч +§ +■ +NBSP +
diff --git a/code_pages/cp857.html b/code_pages/cp857.html new file mode 100644 index 0000000..ad3b555 --- /dev/null +++ b/code_pages/cp857.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 857[7][8][9][3][10] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +à +å +ç +ê +ë +è +ï +î +ı +Ä +Å +
9x +É +æ +Æ +ô +ö +ò +û +ù +İ +Ö +Ü +ø +£ +Ø +Ş +ş +
Ax +á +í +ó +ú +ñ +Ñ +Ğ +ğ +¿ +® +¬ +½ +¼ +¡ +« +» +
Bx +░ +▒ +▓ +│ +┤ +Á +Â +À +© +╣ +║ +╗ +╝ +¢ +¥ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +ã +Ã +╚ +╔ +╩ +╦ +╠ +═ +╬ +¤ +
Dx +º +ª +Ê +Ë +È +€ +Í +Î +Ï +┘ +┌ +█ +▄ +¦ +Ì +▀ +
Ex +Ó +ß +Ô +Ò +õ +Õ +µ + +× +Ú +Û +Ù +ì +ÿ +¯ +´ +
Fx +SHY +± + +¾ + +§ +÷ +¸ +° +¨ +· +¹ +³ +² +■ +NBSP +
diff --git a/code_pages/cp860.html b/code_pages/cp860.html new file mode 100644 index 0000000..5cd109b --- /dev/null +++ b/code_pages/cp860.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 860[5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ã +à +Á +ç +ê +Ê +è +Í +Ô +ì +Ã +Â +
9x +É +À +È +ô +õ +ò +Ú +ù +Ì +Õ +Ü +¢ +£ +Ù +₧ +Ó +
Ax +á +í +ó +ú +ñ +Ñ +ª +º +¿ +Ò +¬ +½ +¼ +¡ +« +» +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +α +ß +Γ +π +Σ +σ +µ +τ +Φ +Θ +Ω +δ +∞ +φ +ε +∩ +
Fx +≡ +± +≥ +≤ +⌠ +⌡ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp861.html b/code_pages/cp861.html new file mode 100644 index 0000000..f8ee304 --- /dev/null +++ b/code_pages/cp861.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 861[5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +à +å +ç +ê +ë +è +Ð +ð +Þ +Ä +Å +
9x +É +æ +Æ +ô +ö +þ +û +Ý +ý +Ö +Ü +ø +£ +Ø +₧ +ƒ +
Ax +á +í +ó +ú +Á +Í +Ó +Ú +¿ +⌐ +¬ +½ +¼ +¡ +« +» +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +α +ß +Γ +π +Σ +σ +µ +τ +Φ +Θ +Ω +δ +∞ +φ +ε +∩ +
Fx +≡ +± +≥ +≤ +⌠ +⌡ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp862.html b/code_pages/cp862.html new file mode 100644 index 0000000..e418a07 --- /dev/null +++ b/code_pages/cp862.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 862[3][7][8][9][10] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +א +ב +ג +ד +ה +ו +ז +ח +ט +י +ך +כ +ל +ם +מ +ן +
9x +נ +ס +ע +ף +פ +ץ +צ +ק +ר +ש +ת +¢ +£ +¥ +₧ +ƒ +
Ax +á +í +ó +ú +ñ +Ñ +ª +º +¿ +⌐ +¬ +½ +¼ +¡ +« +» +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +α +ß +Γ +π +Σ +σ +µ +τ +Φ +Θ +Ω +δ +∞ +φ +ε +∩ +
Fx +≡ +± +≥ +≤ +⌠ +⌡ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp863.html b/code_pages/cp863.html new file mode 100644 index 0000000..9aaeed2 --- /dev/null +++ b/code_pages/cp863.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 863[5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +Â +à + +ç +ê +ë +è +ï +î +‗ +À +§ +
9x +É +È +Ê +ô +Ë +Ï +û +ù +¤ +Ô +Ü +¢ +£ +Ù +Û +ƒ +
Ax +¦ +´ +ó +ú +¨ +¸ +³ +¯ +Î +⌐ +¬ +½ +¼ +¾ +« +» +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +α +ß +Γ +π +Σ +σ +µ +τ +Φ +Θ +Ω +δ +∞ +φ +ε +∩ +
Fx +≡ +± +≥ +≤ +⌠ +⌡ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp864.html b/code_pages/cp864.html new file mode 100644 index 0000000..a9b00ec --- /dev/null +++ b/code_pages/cp864.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 864[5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +☺ +♪ +♫ +☼ +═ +║ +╬ +╣ +╦ +╠ +╩ +╗ +╔ +╚ +╝ +
1x +► +◄ +↕ +‼ + +§ +▬ +↨ +↑ +↓ +→ +← +∟ +↔ +▲ +▼ +
2x + SP  +! +" +# +$ +٪ +& +' +( +) +٭ ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +⌂ +
8x +° +· +∙ +√ +▒ +─ +│ +┼ +┤ +┬ +├ +┴ +┐ +┌ +└ +┘ +
9x +β +∞ +φ +± +½ +¼ +≈ +« +» +ﻷ +ﻸ + + +ﻻ +ﻼ +ﹳ +
Ax +NBSP +SHY +ﺂ +£ +¤ +ﺄ + +€ +ﺎ +ﺏ +ﺕ +ﺙ +، +ﺝ +ﺡ +ﺥ +
Bx +٠ +١ +٢ +٣ +٤ +٥ +٦ +٧ +٨ +٩ +ﻑ +؛ +ﺱ +ﺵ +ﺹ +؟ +
Cx +¢ +ﺀ +ﺁ +ﺃ +ﺅ +ﻊ +ﺋ +ﺍ +ﺑ +ﺓ +ﺗ +ﺛ +ﺟ +ﺣ +ﺧ +ﺩ +
Dx +ﺫ +ﺭ +ﺯ +ﺳ +ﺷ +ﺻ +ﺿ +ﻁ +ﻅ +ﻋ +ﻏ +¦ +¬ +÷ +× +ﻉ +
Ex +ـ +ﻓ +ﻗ +ﻛ +ﻟ +ﻣ +ﻧ +ﻫ +ﻭ +ﻯ +ﻳ +ﺽ +ﻌ +ﻎ +ﻍ +ﻡ +
Fx +ﹽ +_ّ +ﻥ +ﻩ +ﻬ +ﻰ +ﻲ +ﻐ +ﻕ +ﻵ +ﻶ +ﻝ +ﻙ +ﻱ +■ + +
diff --git a/code_pages/cp865.html b/code_pages/cp865.html new file mode 100644 index 0000000..cd26a88 --- /dev/null +++ b/code_pages/cp865.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 865[5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ç +ü +é +â +ä +à +å +ç +ê +ë +è +ï +î +ì +Ä +Å +
9x +É +æ +Æ +ô +ö +ò +û +ù +ÿ +Ö +Ü +ø +£ +Ø +₧ +ƒ +
Ax +á +í +ó +ú +ñ +Ñ +ª +º +¿ +⌐ +¬ +½ +¼ +¡ +« +¤ +
Bx +░ +▒ +▓ +│ +┤ +╡ +╢ +╖ +╕ +╣ +║ +╗ +╝ +╜ +╛ +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +╞ +╟ +╚ +╔ +╩ +╦ +╠ +═ +╬ +╧ +
Dx +╨ +╤ +╥ +╙ +╘ +╒ +╓ +╫ +╪ +┘ +┌ +█ +▄ +▌ +▐ +▀ +
Ex +α +ß +Γ +π +Σ +σ +μ +τ +Φ +Θ +Ω +δ +∞ +φ +ε +∩ +
Fx +≡ +± +≥ +≤ +⌠ +⌡ +÷ +≈ +° +∙ +· +√ +ⁿ +² +■ +NBSP +
diff --git a/code_pages/cp866.html b/code_pages/cp866.html new file mode 100644 index 0000000..b5c071d --- /dev/null +++ b/code_pages/cp866.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 866[12][5][3][13][14][15] [16] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +☺
263A +
☻
263B +
♥
2665 +
♦
2666 +
♣
2663 +
♠
2660 +
•
2022 +
◘
25D8 +
○
25CB +
◙
25D9 +
♂
2642 +
♀
2640 +
♪
266A +
♫
266B +
☼
263C +
1x +►
25BA +
◄
25C4 +
↕
2195 +
‼
203C +

00B6 +
§
00A7 +
▬
25AC +
↨
21A8 +
↑
2191 +
↓
2193 +
→
2192 +
←
2190 +
∟
221F +
↔
2194 +
▲
25B2 +
▼
25BC +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +⌂
2302 +
8x +А
0410 +
Б
0411 +
В
0412 +
Г
0413 +
Д
0414 +
Е
0415 +
Ж
0416 +
З
0417 +
И
0418 +
Й
0419 +
К
041A +
Л
041B +
М
041C +
Н
041D +
О
041E +
П
041F +
9x +Р
0420 +
С
0421 +
Т
0422 +
У
0423 +
Ф
0424 +
Х
0425 +
Ц
0426 +
Ч
0427 +
Ш
0428 +
Щ
0429 +
Ъ
042A +
Ы
042B +
Ь
042C +
Э
042D +
Ю
042E +
Я
042F +
Ax +а
0430 +
б
0431 +
в
0432 +
г
0433 +
д
0434 +
е
0435 +
ж
0436 +
з
0437 +
и
0438 +
й
0439 +
к
043A +
л
043B +
м
043C +
н
043D +
о
043E +
п
043F +
Bx +░
2591 +
▒
2592 +
▓
2593 +
│
2502 +
┤
2524 +
╡
2561 +
╢
2562 +
╖
2556 +
╕
2555 +
╣
2563 +
║
2551 +
╗
2557 +
╝
255D +
╜
255C +
╛
255B +
┐
2510 +
Cx +└
2514 +
┴
2534 +
┬
252C +
├
251C +
─
2500 +
┼
253C +
╞
255E +
╟
255F +
╚
255A +
╔
2554 +
╩
2569 +
╦
2566 +
╠
2560 +
═
2550 +
╬
256C +
╧
2567 +
Dx +╨
2568 +
╤
2564 +
╥
2565 +
╙
2559 +
╘
2558 +
╒
2552 +
╓
2553 +
╫
256B +
╪
256A +
┘
2518 +
┌
250C +
█
2588 +
▄
2584 +
▌
258C +
▐
2590 +
▀
2580 +
Ex +р
0440 +
с
0441 +
т
0442 +
у
0443 +
ф
0444 +
х
0445 +
ц
0446 +
ч
0447 +
ш
0448 +
щ
0449 +
ъ
044A +
ы
044B +
ь
044C +
э
044D +
ю
044E +
я
044F +
Fx +Ё
0401 +
ё
0451 +
Є
0404 +
є
0454 +
Ї
0407 +
ї
0457 +
Ў
040E +
ў
045E +
°
00B0 +
∙
2219 +
·
00B7 +
√
221A +
№
2116 +
¤
00A4 +
■
25A0 +
NBSP
00A0 +
diff --git a/code_pages/cp869.html b/code_pages/cp869.html new file mode 100644 index 0000000..ac73fde --- /dev/null +++ b/code_pages/cp869.html @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Code page 869[5][6][7][8] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x + + + + + + +Ά +€ +· +¬ +¦ +‘ +’ +Έ +― +Ή +
9x +Ί +Ϊ +Ό + + +Ύ +Ϋ +© +Ώ +² +³ +ά +£ +έ +ή +ί +
Ax +ϊ +ΐ +ό +ύ +Α +Β +Γ +Δ +Ε +Ζ +Η +½ +Θ +Ι +« +» +
Bx +░ +▒ +▓ +│ +┤ +Κ +Λ +Μ +Ν +╣ +║ +╗ +╝ +Ξ +Ο +┐ +
Cx +└ +┴ +┬ +├ +─ +┼ +Π +Ρ +╚ +╔ +╩ +╦ +╠ +═ +╬ +Σ +
Dx +Τ +Υ +Φ +Χ +Ψ +Ω +α +β +γ +┘ +┌ +█ +▄ +δ +ε +▀ +
Ex +ζ +η +θ +ι +κ +λ +μ +ν +ξ +ο +π +ρ +σ +ς +τ +΄ +
Fx +SHY +± +υ +φ +χ +§ +ψ +΅ +° +¨ +ω +ϋ +ΰ +ώ +■ +NBSP +
diff --git a/code_pages/get_code_pages.py b/code_pages/get_code_pages.py new file mode 100755 index 0000000..946b7e4 --- /dev/null +++ b/code_pages/get_code_pages.py @@ -0,0 +1,275 @@ +#!/bin/env python + +from bs4 import BeautifulSoup +import json +import re +import os + +ASCII = { + "NUL": 0x0, + "SOH": 0x1, + "STX": 0x2, + "ETX": 0x3, + "EOT": 0x4, + "ENQ": 0x5, + "ACK": 0x6, + "BEL": 0x7, + "BS": 0x08, + "TAB": 0x09, + "HT": 0x09, + "LF": 0x10, + "VT": 0x11, + "FF": 0x12, + "CR": 0x13, + "SO": 0x14, + "SI": 0x15, + "DLE": 0x16, + "DC1": 0x17, + "DC2": 0x18, + "DC3": 0x19, + "DC4": 0x20, + "NAK": 0x21, + "SYN": 0x22, + "ETB": 0x23, + "CAN": 0x24, + "EM": 0x25, + "SUB": 0x26, + "ESC": 0x27, + "FS": 0x28, + "GS": 0x29, + "RS": 0x30, + "US": 0x31, + "SP": 0x32, + "DEL": 0x7F, + "LRM": 0xE2808E, + "RLM": 0xE280AF, + "SHY": 0xC2AD, + "NBSP": 0xC2A0, +} + +# Relation of ESC/POS CODE PAGE NUMBER : MY SHITTY PRINTER NUMBER +# 1 Katakana prints something different from the esc/pos +PAGE_NUMBERS = { + 0: 0, + 2: 2, + 3: 3, + 4: 4, + 5: 5, + 16: 16, + 17: 17, + 18: 18, + 46: 23, + 51: 25, + 37: 28, + 49: 32, + 35: 56, + 34: 60, + 13: 61, + 36: 62, + 14: 64, + 11: 65, + 45: 72, + 47: 90, + 48: 91, + 50: 92, + 32: 93, + 52: 94, + 33: 95, +} +# Where is the 16th ? + + +def get_hex_string(original: str): + data = bytes(original, encoding='utf-8') + strhex = ''.join(format(byte, '02X') for byte in data) + + return strhex + + +def get_unicode_codepoint_string(original: str): + if len(original) != 1: + return '' + + char = ord(original) + val = format(char, '02X') + return val + + +def clean_char_representation(input_string): + # Regular expression pattern to match strings with square brackets and + # contents inside + result = input_string + pattern = r'\[[^\]]+\]' + + # Remove the square brackets and contents inside from each match + result = re.sub(pattern, '', result) + + # Check if the last 4 characters are hexadecimal + if re.match(r'[0-9A-Fa-f]{4}$', result[-4:]): + # If they are, remove them + result = result[:-4] + + return result + + +def get_codepoint(input: str): + # Regular expression pattern to match Unicode string representations + unicode_pattern = r'U\+[0-9A-Fa-f]{4}' + + # Find all matches in the input string + matches = re.findall(unicode_pattern, input) + + # Print the matches + if matches: + return matches[0] + + +def get_hex_code(codepoint: str): + # Parse the hexadecimal value from the string representation + # Skip the "U+" prefix and convert to integer + if codepoint is None: + return None + + hex_value = int(codepoint[2:], 16) + + # Convert the integer to a character + char = chr(hex_value) + + # Encode the character to UTF-8 bytes + utf8_bytes = char.encode('utf-8') + + # Convert each byte to its hexadecimal representation + hex_representation = ''.join(format(byte, '02X') for byte in utf8_bytes) + + return hex_representation + + +def get_escpos(left: str, right: str): + return left[0] + right + + +def make_charmap(file): + # htmlTable + with open(file, "r") as t: + html_content = t.read() + + # Parse the HTML content + soup = BeautifulSoup(html_content, 'html.parser') + + # We only have a html table in the html of the file so we can go with it + table = soup.table + + # Extract data from each row of the table + rows = table.select("tr") + index = [x for x in rows[0].text.strip() if x != '\n'] + # print(index) + + charset = [] + for row in rows[1:]: + cells = row.select("td") + cur_row = cells[0].text.strip() + + counter = 0 + for cell in cells[1:]: + escpos = get_escpos(cur_row, index[counter]) + if len(escpos) > 2: + print("escpos representation cannot be longer than 2 bytes.") + exit(1) + + codepoint = get_codepoint(cell.attrs.get('title')) + hexcode = get_hex_code(codepoint) + + character = cell.text.strip() + if len(character) > 1: + character = clean_char_representation(character) + + int_escpos = int(escpos, 16) + if int_escpos > 0xFF or int_escpos < 0x80: + continue + + if hexcode is None: + character = None + else: + hexcode = "0x" + character + + cur_data = { + "escpos_hex": "0x" + escpos, + # "utf_hex": hexcode, + "unicode_cp": codepoint, + "character": character, + } + + print(cur_data) + + charset.append(cur_data) + counter += 1 + + file_name_metadata = ( + file.replace(".html", "").replace("./", "").split('_') + ) + charmap = { + "code-page-number": int(file_name_metadata[0]), + "code-page-name": file_name_metadata[1], + "charset": charset, + } + return charmap + + +def list_tables(dir_path): + tables = [] + for f in os.listdir(dir_path): + if f.endswith(".html"): + tables.append(f) + + return tables + + +def main(): + dir = "./" + tables = list_tables(dir) + all_charmaps = [] + for t in tables: + charmap = make_charmap(dir + t) + all_charmaps.append(charmap) + json_name = dir + t.replace('.html', '.json') + # print(json.dumps(charmap)) + # + # with open(json_name, 'w') as f: + # json.dump(charmap, f) + + characters = {} + for charmap in all_charmaps: + for charset in charmap["charset"]: + data = { + "code-page-number": charmap["code-page-number"], + "escpos": charset["escpos_hex"], + } + if charset["unicode_cp"] in characters: + characters[charset["unicode_cp"]].append(data) + else: + characters[charset["unicode_cp"]] = [data] + + # print(json.dumps(characters)) + # with open('5890_charmap.json', 'w') as f: + # json.dump(characters, f) + + +if __name__ == "__main__": + main() + + +# Its missing: +# Katakana +# TCVN-3 +# CP1125 +# Some hebrew chars, will work on them later I guess + +# Its working: +# For CP: 775, 850, 860, 863, 865, 851, 853, 857, 737, 866, 852, +# 720,855, 861, 862, 864, 869, 1098 +# ISO: 8859-7, 8859-2, 8859-15 +# WCP: 1252, 775, 1250, 1251, 1253, 1254, 1255, 1256, 1257, 1258 +# KZ: 1048 + +# The KZ 1048 is a table with the rows 8x to Bx and replaces those +# rows on the table wcp1251 diff --git a/code_pages/iconvtest/__pycache__/codepages.cpython-312.pyc b/code_pages/iconvtest/__pycache__/codepages.cpython-312.pyc new file mode 100644 index 0000000..f7902c4 Binary files /dev/null and b/code_pages/iconvtest/__pycache__/codepages.cpython-312.pyc differ diff --git a/code_pages/iconvtest/codepages.py b/code_pages/iconvtest/codepages.py new file mode 100644 index 0000000..fea3ae8 --- /dev/null +++ b/code_pages/iconvtest/codepages.py @@ -0,0 +1,72 @@ +codePages = { + "0": "CP437", + "1": "KATAKANA", + "2": "CP850", + "3": "CP860", + "4": "CP863", + "5": "CP865", + "6": "Unknown", + "7": "Unknown", + "8": "Unknown", + "9": "Unknown", + "10": "Unknown", + "11": "Unknown", + "12": "Unknown", + "13": "Unknown", + "14": "Unknown", + "15": "Unknown", + "16": "CP1252", + "17": "CP866", + "18": "CP852", + "19": "CP858", + "20": "Unknown", + "21": "Unknown", + "22": "Unknown", + "23": "Unknown", + "24": "CP747", + "25": "CP1257", + "26": "Unknown", + "27": "Unknown", + "28": "CP864", + "31": "Unknown", + "32": "CP1255", + "53": "CP858", + "54": "CP852", + "55": "CP860", + "56": "CP861", + "57": "CP863", + "58": "CP865", + "59": "CP866", + "60": "CP855", + "61": "CP857", + "62": "CP862", + "63": "CP864", + "64": "CP737", + "65": "CP851", + "66": "CP869", + "68": "CP772", + "69": "CP774", + "71": "CP1252", + "72": "CP1250", + "73": "CP1251", + "74": "CP3840", + "76": "CP3843", + "77": "CP3844", + "78": "CP3845", + "79": "CP3846", + "80": "CP3847", + "81": "CP3848", + "83": "CP2001", + "84": "CP3001", + "85": "CP3002", + "86": "CP3011", + "87": "CP3012", + "88": "CP3021", + "89": "CP3041", + "90": "CP1253", + "91": "CP1254", + "92": "CP1256", + "93": "CP720", + "94": "CP1258", + "95": "CP775", +} diff --git a/code_pages/iconvtest/cp437_chars.txt b/code_pages/iconvtest/cp437_chars.txt new file mode 100644 index 0000000..21df114 Binary files /dev/null and b/code_pages/iconvtest/cp437_chars.txt differ diff --git a/code_pages/iconvtest/main.py b/code_pages/iconvtest/main.py new file mode 100755 index 0000000..3e8a1b1 --- /dev/null +++ b/code_pages/iconvtest/main.py @@ -0,0 +1,41 @@ +#!/bin/env python + +import json +import subprocess + +PATH = "/home/esilva/Desktop/projetos/escpos-printer-db/dist/capabilities.json" +COMMAND = """iconv -f {charset} -t UTF-8 < +ISO/IEC 8859-15[11][12][13] + + + + +0 + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +A + +B + +C + +D + +E + +F + + +0x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +2x + + SP  + +! + +" + +# + +$ + +% + +& + +' + +( + +) + +* + ++ + +, + +- + +. + +/ + + +3x + +0 + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +: + +; + +< + += + +> + +? + + +4x + +@ + +A + +B + +C + +D + +E + +F + +G + +H + +I + +J + +K + +L + +M + +N + +O + + +5x + +P + +Q + +R + +S + +T + +U + +V + +W + +X + +Y + +Z + +[ + +\ + +] + +^ + +_ + + +6x + +` + +a + +b + +c + +d + +e + +f + +g + +h + +i + +j + +k + +l + +m + +n + +o + + +7x + +p + +q + +r + +s + +t + +u + +v + +w + +x + +y + +z + +{ + +| + +} + +~ + + + + +8x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +9x + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Ax + +NBSP + +¡ + +¢ + +£ + +€
20AC + +¥ + +Š
0160 + +§ + +š
0161 + +© + +ª + +« + +¬ + +SHY + +® + +¯ + + +Bx + +° + +± + +² + +³ + +Ž
017D + +µ + + + +· + +ž
017E + +¹ + +º + +» + +Œ
0152 + +œ
0153 + +Ÿ
0178 + +¿ + + +Cx + +À + +Á + +Â + +Ã + +Ä + +Å + +Æ + +Ç + +È + +É + +Ê + +Ë + +Ì + +Í + +Î + +Ï + + +Dx + +Ð + +Ñ + +Ò + +Ó + +Ô + +Õ + +Ö + +× + +Ø + +Ù + +Ú + +Û + +Ü + +Ý + +Þ + +ß + + +Ex + +à + +á + +â + +ã + +ä + +å + +æ + +ç + +è + +é + +ê + +ë + +ì + +í + +î + +ï + + +Fx + +ð + +ñ + +ò + +ó + +ô + +õ + +ö + +÷ + +ø + +ù + +ú + +û + +ü + +ý + +þ + +ÿ + diff --git a/code_pages/iso8859-2.html b/code_pages/iso8859-2.html new file mode 100644 index 0000000..9280dbe --- /dev/null +++ b/code_pages/iso8859-2.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ISO/IEC 8859-2 (Latin-2) +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x + + + + + + + + + + + + + + + + +
1x + + + + + + + + + + + + + + + + +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ + +
8x + + + + + + + + + + + + + + + + +
9x + + + + + + + + + + + + + + + + +
Ax +NBSP +Ą
0104 +
˘
02D8 +
Ł
0141 +
¤ +Ľ
013D +
Ś
015A +
§ +¨ +Š
0160 +
Ş
015E +
Ť
0164 +
Ź
0179 +
SHY +Ž
017D +
Ż
017B +
Bx +° +ą
0105 +
˛
02DB +
ł
0142 +
´ +ľ
013E +
ś
015B +
ˇ
02C7 +
¸ +š
0161 +
ş
015F +
ť
0165 +
ź
017A +
˝
02DD +
ž
017E +
ż
017C +
Cx +Ŕ
0154 +
Á +Â +Ă
0102 +
Ä +Ĺ
0139 +
Ć
0106 +
Ç +Č
010C +
É +Ę
0118 +
Ë +Ě
011A +
Í +Î +Ď
010E +
Dx +Đ
0110 +
Ń
0143 +
Ň
0147 +
Ó +Ô +Ő
0150 +
Ö +× +Ř
0158 +
Ů
016E +
Ú +Ű
0170 +
Ü +Ý +Ţ
0162 +
ß +
Ex +ŕ
0155 +
á +â +ă
0103 +
ä +ĺ
013A +
ć
0107 +
ç +č
010D +
é +ę
0119 +
ë +ě
011B +
í +î +ď
010F +
Fx +đ
0111 +
ń
0144 +
ň
0148 +
ó +ô +ő
0151 +
ö +÷ +ř
0159 +
ů
016F +
ú +ű
0171 +
ü +ý +ţ
0163 +
˙
02D9 +
diff --git a/code_pages/iso8859-7.html b/code_pages/iso8859-7.html new file mode 100644 index 0000000..a6a8bbb --- /dev/null +++ b/code_pages/iso8859-7.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ISO/IEC 8859-7[11] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x + + + + + + + + + + + + + + + + +
1x + + + + + + + + + + + + + + + + +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ + +
8x + + + + + + + + + + + + + + + + +
9x + + + + + + + + + + + + + + + + +
Ax +NBSP +‘ +’ +£ +€ +₯ +¦ +§ +¨ +© +ͺ +« +¬ +SHY + +― +
Bx +° +± +² +³ +΄ +΅ +Ά +· +Έ +Ή +Ί +» +Ό +½ +Ύ +Ώ +
Cx +ΐ +Α +Β +Γ +Δ +Ε +Ζ +Η +Θ +Ι +Κ +Λ +Μ +Ν +Ξ +Ο +
Dx +Π +Ρ + +Σ +Τ +Υ +Φ +Χ +Ψ +Ω +Ϊ +Ϋ +ά +έ +ή +ί +
Ex +ΰ +α +β +γ +δ +ε +ζ +η +θ +ι +κ +λ +μ +ν +ξ +ο +
Fx +π +ρ +ς +σ +τ +υ +φ +χ +ψ +ω +ϊ +ϋ +ό +ύ +ώ + +
diff --git a/code_pages/kz1048.html b/code_pages/kz1048.html new file mode 100644 index 0000000..ad92c78 --- /dev/null +++ b/code_pages/kz1048.html @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KZ-1048 (STRK1048-2002)[16] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
8x +Ђ +Ѓ +‚ +ѓ +„ +… +† +‡ +€ +‰ +Љ +‹ +Њ +Қ +Һ +Џ +
9x +ђ +‘ +’ +“ +” +• +– +— + +™ +љ +› +њ +қ +һ +џ +
Ax +NBSP +Ұ +ұ +Ә +¤ +Ө +¦ +§ +Ё +© +Ғ +« +¬ +SHY +® +Ү +
Bx +° +± +І +і +ө +µ + +· +ё +№ +ғ +» +ә +Ң +ң +ү +
diff --git a/code_pages/recei-print-hq_escpos-printer-db_encoding.yml b/code_pages/recei-print-hq_escpos-printer-db_encoding.yml new file mode 100644 index 0000000..bbf5f14 --- /dev/null +++ b/code_pages/recei-print-hq_escpos-printer-db_encoding.yml @@ -0,0 +1,679 @@ +# encoding.yml: This file maps known code pages and other character encodings +# to a method of encoding. +# +# Its purpose is to account for the use of different code page names and +# implementations, so that drivers have a common data set to use for converting +# UTF-8 text into something that a printer is likely to understand. +# +# Where multiple encoders are listed, any of them can be used to give identical +# results. + +--- +CP037: + iconv: CP037 + python_encode: cp037 + +CP038: + iconv: CP038 + +CP273: + iconv: CP273 + python_encode: cp273 + +CP274: + iconv: CP274 + +CP275: + iconv: CP275 + +CP278: + iconv: CP278 + +CP280: + iconv: CP280 + +CP281: + iconv: CP281 + +CP282: + iconv: CP282 + +CP284: + iconv: CP284 + +CP285: + iconv: CP285 + +CP290: + iconv: CP290 + +CP297: + iconv: CP297 + +CP367: + iconv: CP367 + +CP420: + iconv: CP420 + +CP423: + iconv: CP423 + +CP424: + iconv: CP424 + python_encode: cp424 + +CP437: + iconv: CP437 + python_encode: cp437 + +CP500: + iconv: CP500 + python_encode: cp500 + +CP720: + python_encode: cp720 + +CP737: + iconv: CP737 + python_encode: cp737 + +CP747: {} + +CP770: + iconv: CP770 + +CP771: + iconv: CP771 + +CP772: + iconv: CP772 + +CP773: + iconv: CP773 + +CP774: + iconv: CP774 + +CP775: + iconv: CP775 + python_encode: cp775 + +CP803: + iconv: CP803 + +CP813: + iconv: CP813 + +CP819: + iconv: CP819 + +CP850: + iconv: CP850 + python_encode: cp850 + +CP851: + name: "Greek CP851" + notes: "Not used, due to inconsistencies between implementations." + +CP852: + iconv: CP852 + python_encode: cp852 + +CP853: {} + +CP855: + iconv: CP855 + python_encode: cp855 + +CP856: + iconv: CP856 + python_encode: cp856 + +CP857: + iconv: CP857 + python_encode: cp857 + +CP858: + python_encode: cp858 + +CP860: + iconv: CP860 + python_encode: cp860 + +CP861: + iconv: CP861 + python_encode: cp861 + +CP862: + iconv: CP862 + python_encode: cp862 + +CP863: + iconv: CP863 + python_encode: cp863 + +CP864: + iconv: CP864 + python_encode: cp864 + +CP865: + iconv: CP865 + python_encode: cp865 + +CP866: + iconv: CP866 + python_encode: cp866 + +CP866NAV: + iconv: CP866NAV + +CP868: + iconv: CP868 + +CP869: + iconv: CP869 + python_encode: cp869 + +CP870: + iconv: CP870 + +CP871: + iconv: CP871 + +CP874: + iconv: CP874 + python_encode: cp874 + +CP875: + iconv: CP875 + python_encode: cp875 + +CP880: + iconv: CP880 + +CP891: + iconv: CP891 + +CP901: + iconv: CP901 + +CP902: + iconv: CP902 + +CP903: + iconv: CP903 + +CP904: + iconv: CP904 + +CP905: + iconv: CP905 + +CP912: + iconv: CP912 + +CP915: + iconv: CP915 + +CP916: + iconv: CP916 + +CP918: + iconv: CP918 + +CP920: + iconv: CP920 + +CP921: + iconv: CP921 + +CP922: + iconv: CP922 + +CP928: {} + +CP930: + iconv: CP930 + +CP932: + iconv: CP932 + python_encode: cp932 + +CP933: + iconv: CP933 + +CP935: + iconv: CP935 + +CP936: + iconv: CP936 + +CP937: + iconv: CP937 + +CP939: + iconv: CP939 + +CP949: + iconv: CP949 + python_encode: cp949 + +CP950: + iconv: CP950 + python_encode: cp950 + +CP1001: + name: Unimplemented Star-specific CP1001 + +CP1004: + iconv: CP1004 + +CP1006: + python_encode: cp1006 + +CP1008: + iconv: CP1008 + +CP1025: + iconv: CP1025 + +CP1026: + iconv: CP1026 + python_encode: cp1026 + +CP1046: + iconv: CP1046 + +CP1047: + iconv: CP1047 + +CP1070: + iconv: CP1070 + +CP1079: + iconv: CP1079 + +CP1081: + iconv: CP1081 + +CP1084: + iconv: CP1084 + +CP1089: + iconv: CP1089 + +CP1097: + iconv: CP1097 + +CP1098: {} + +CP1112: + iconv: CP1112 + +CP1122: + iconv: CP1122 + +CP1123: + iconv: CP1123 + +CP1124: + iconv: CP1124 + +CP1125: + iconv: CP1125 + python_encode: cp1125 + +CP1129: + iconv: CP1129 + +CP1130: + iconv: CP1130 + +CP1132: + iconv: CP1132 + +CP1133: + iconv: CP1133 + +CP1137: + iconv: CP1137 + +CP1140: + iconv: CP1140 + python_encode: cp1140 + +CP1141: + iconv: CP1141 + +CP1142: + iconv: CP1142 + +CP1143: + iconv: CP1143 + +CP1144: + iconv: CP1144 + +CP1145: + iconv: CP1145 + +CP1146: + iconv: CP1146 + +CP1147: + iconv: CP1147 + +CP1148: + iconv: CP1148 + +CP1149: + iconv: CP1149 + +CP1153: + iconv: CP1153 + +CP1154: + iconv: CP1154 + +CP1155: + iconv: CP1155 + +CP1156: + iconv: CP1156 + +CP1157: + iconv: CP1157 + +CP1158: + iconv: CP1158 + +CP1160: + iconv: CP1160 + +CP1161: + iconv: CP1161 + +CP1162: + iconv: CP1162 + +CP1163: + iconv: CP1163 + +CP1164: + iconv: CP1164 + +CP1166: + iconv: CP1166 + +CP1167: + iconv: CP1167 + +CP1250: + iconv: CP1250 + python_encode: cp1250 + +CP1251: + iconv: CP1251 + python_encode: cp1251 + +CP1252: + iconv: CP1252 + python_encode: cp1252 + +CP1253: + iconv: CP1253 + python_encode: cp1253 + +CP1254: + iconv: CP1254 + python_encode: cp1254 + +CP1255: + iconv: CP1255 + python_encode: cp1255 + +CP1256: + iconv: CP1256 + python_encode: cp1256 + +CP1257: + iconv: CP1257 + python_encode: cp1257 + +CP1258: + iconv: CP1258 + python_encode: cp1258 + +CP1282: + iconv: CP1282 + +CP1361: + iconv: CP1361 + +CP1364: + iconv: CP1364 + +CP1371: + iconv: CP1371 + +CP1388: + iconv: CP1388 + +CP1390: + iconv: CP1390 + +CP1399: + iconv: CP1399 + +CP2001: + name: Unimplemented Star-specific CP2001 + +CP3001: + name: Unimplemented Star-specific CP3001 + +CP3002: + name: Unimplemented Star-specific CP3002 + +CP3011: + name: "CP3011 Latvian" + data: + - "ÇüéâäàåçêëèïîìÄÅ" + - "ÉæÆôöòûùÿÖÜ¢£¥₧ƒ" + - "áíóúñѪº¿⌐¬½¼¡«»" + - "░▒▓│┤Ā╢ņ╕╣║╗╝╜╛┐" + - "└┴┬├─┼ā╟╚╔╩╦╠═╬╧" + - "Š╤čČ╘╒ģĪī┘┌█▄ūŪ▀" + - "αßΓπΣσµτΦΘΩδ∞φε∩" + - "ĒēĢķĶļĻžŽ∙·√Ņš■ " + +CP3012: + name: "CP3012 Cyrillic" + data: + - "АБВГДЕЖЗИЙКЛМНОП" + - "РСТУФХЦЧШЩЪЫЬЭЮЯ" + - "абвгдежзийклмноп" + - "░▒▓│┤Ā╢ņ╕╣║╗╝Ō╛┐" + - "└┴┬├─┼ā╟╚╔╩╦╠═╬╧" + - "Š╤čČ╘╒ģĪī┘┌█▄ūŪ▀" + - "рстуфхцчшщъыьэюя" + - "ĒēĢķĶļĻžŽ∙·√Ņš■ " + +CP3021: + name: Unimplemented Star-specific CP3021 + +CP3041: + name: Unimplemented Star-specific CP3041 + +CP3840: + name: Unimplemented Star-specific CP3840 + +CP3841: + name: Unimplemented Star-specific CP3841 + +CP3843: + name: Unimplemented Star-specific CP3843 + +CP3844: + name: Unimplemented Star-specific CP3844 + +CP3845: + name: Unimplemented Star-specific CP3845 + +CP3847: + name: Unimplemented Star-specific CP3847 + +CP3846: + name: Unimplemented Star-specific CP3846 + +CP3848: + name: Unimplemented Star-specific CP3848 + +CP4517: + iconv: CP4517 + +CP4899: + iconv: CP4899 + +CP4909: + iconv: CP4909 + +CP4971: + iconv: CP4971 + +CP5347: + iconv: CP5347 + +CP9030: + iconv: CP9030 + +CP9066: + iconv: CP9066 + +CP9448: + iconv: CP9448 + +CP10007: + iconv: CP10007 + +CP12712: + iconv: CP12712 + +CP16804: + iconv: CP16804 + +ISO_8859-1: + iconv: "ISO_8859-1" + python_encode: "latin_1" + +ISO_8859-2: + iconv: "ISO_8859-2" + python_encode: "iso8859_2" + +ISO_8859-3: + iconv: "ISO_8859-3" + python_encode: "iso8859_3" + +ISO_8859-4: + iconv: "ISO_8859-4" + python_encode: "iso8859_4" + +ISO_8859-5: + iconv: "ISO_8859-5" + python_encode: "iso8859_5" + +ISO_8859-6: + iconv: "ISO_8859-6" + python_encode: "iso8859_6" + +ISO_8859-7: + iconv: "ISO_8859-7" + python_encode: "iso8859_7" + +ISO_8859-8: + iconv: "ISO_8859-8" + python_encode: "iso8859_8" + +ISO_8859-9: + iconv: "ISO_8859-9" + python_encode: "iso8859_9" + +ISO_8859-10: + iconv: "ISO_8859-10" + python_encode: "iso8859-10" + +ISO_8859-11: + iconv: "ISO_8859-11" + python_encode: "iso8859-11" + +ISO_8859-13: + iconv: "ISO_8859-13" + python_encode: "iso8859-13" + +ISO_8859-14: + iconv: "ISO_8859-14" + python_encode: "iso8859-14" + +ISO_8859-15: + iconv: "ISO_8859-15" + python_encode: "iso8859-15" + +ISO_8859-16: + iconv: "ISO_8859-16" + python_encode: "iso8859_16" + +RK1048: + iconv: RK1048 + +TCVN-3-1: + name: "Vietnamese TCVN-3 1" + data: + - " " + - " " + - " ăâêôơưđ " + - " àảãáạ ằẳẵắ " + - " ặầẩẫấậè ẻẽ" + - "éẹềểễếệìỉ ĩíịò" + - " ỏõóọồổỗốộờởỡớợù" + - " ủũúụừửữứựỳỷỹýỵ " + +TCVN-3-2: + name: "Vietnamese TCVN-3 1" + data: + - " " + - " " + - " Ă РÊÔƠƯ " + - " ÀẢÃÁẠ ẰẲẴẮ " + - " ẶẦẨẪẤẬÈ ẺẼ" + - "ÉẸỀỂỄẾỆÌỈ ĨÍỊÒ" + - " ỎÕÓỌỒỔỖỐỘỜỞỠỚỢÙ" + - " ỦŨÚỤỪỬỮỨỰỲỶỸÝỴ " + +OXHOO-EUROPEAN: + name: Oxhoo-specific European + data: + - "ÇüéâäàåçêëèïîìÄÅ" + - "ÉæÆôöòûùÿÖÜñѪº¿" + - "áíóú¢£¥₧ƒ¡ÃãÕõØø" + - "·¨°`´½¼×÷≤≥«»≠√¯" + - "⌠⌡∞◤↵↑↓→←┌┐└┘•®©" + # Some unidentified chars + - "™†§¶Γ◢Θ " + - "ß ε " + - "τ " + +KATAKANA: + name: Katakana (codepage 1) + data: + - "▁▂▃▄▅▆▇█▏▎▍▌▋▊▉┼" + - "┴┬┤├¯─│▕┌┐└┘╭╮╰╯" + - " 。「」、・ヲァィゥェォャュョッ" + - "ーアイウエオカキクケコサシスセソ" + - "タチツテトナニヌネノハヒフヘホマ" + - "ミムメモヤユヨラリルレロワン゙゚" + - "═╞╪╡◢◣◥◤♠♥♦♣●○╱╲" + - "╳円年月日時分秒〒市区町村人▓\u00A0" + +Unknown: + name: Unknown + notes: Code page that has not yet been identified. diff --git a/code_pages/wcp1250.html b/code_pages/wcp1250.html new file mode 100644 index 0000000..0c9de57 --- /dev/null +++ b/code_pages/wcp1250.html @@ -0,0 +1,853 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1250[12] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ + +‚ + +„ +… +† +‡ + +‰ +Š +‹ +Ś +Ť +Ž +Ź +
9x + +‘ +’ +“ +” +• +– +— + +™ +š +› +ś +ť +ž +ź +
Ax +NBSP +ˇ +˘ +Ł +¤ +Ą +¦ +§ +¨ +© +Ş +« +¬ +SHY +® +Ż +
Bx +° +± +˛ +ł +´ +µ + +· +¸ +ą +ş +» +Ľ +˝ +ľ +ż +
Cx +Ŕ +Á +Â +Ă +Ä +Ĺ +Ć +Ç +Č +É +Ę +Ë +Ě +Í +Î +Ď +
Dx +Đ +Ń +Ň +Ó +Ô +Ő +Ö +× +Ř +Ů +Ú +Ű +Ü +Ý +Ţ +ß +
Ex +ŕ +á +â +ă +ä +ĺ +ć +ç +č +é +ę +ë +ě +í +î +ď +
Fx +đ +ń +ň +ó +ô +ő +ö +÷ +ř +ů +ú +ű +ü +ý +ţ +˙ +
diff --git a/code_pages/wcp1251.html b/code_pages/wcp1251.html new file mode 100644 index 0000000..44a82d3 --- /dev/null +++ b/code_pages/wcp1251.html @@ -0,0 +1,854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1251[15] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +Ђ +Ѓ +‚ +ѓ +„ +… +† +‡ +€ +‰ +Љ +‹ +Њ +Ќ +Ћ +Џ +
9x +ђ +‘ +’ +“ +” +• +– +— + +™ +љ +› +њ +ќ +ћ +џ +
Ax +NBSP +Ў +ў +Ј +¤ +Ґ +¦ +§ +Ё +© +Є +« +¬ +SHY +® +Ї +
Bx +° +± +І +і +ґ +µ + +· +ё +№ +є +» +ј +Ѕ +ѕ +ї +
Cx +А +Б +В +Г +Д +Е +Ж +З +И +Й +К +Л +М +Н +О +П +
Dx +Р +С +Т +У +Ф +Х +Ц +Ч +Ш +Щ +Ъ +Ы +Ь +Э +Ю +Я +
Ex +а +б +в +г +д +е +ж +з +и +й +к +л +м +н +о +п +
Fx +р +с +т +у +ф +х +ц +ч +ш +щ +ъ +ы +ь +э +ю +я +
diff --git a/code_pages/wcp1252.html b/code_pages/wcp1252.html new file mode 100644 index 0000000..84d6675 --- /dev/null +++ b/code_pages/wcp1252.html @@ -0,0 +1,849 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1252 (CP1252)[18][19][20][21][22] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0_ +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1_ +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2_ + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3_ +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4_ +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5_ +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6_ +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7_ +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8_ +€
20AC +
+‚
201A +
ƒ
0192 +
„
201E +
…
2026 +
†
2020 +
‡
2021 +
ˆ
02C6 +
‰
2030 +
Š
0160 +
‹
2039 +
Œ
0152 +
+Ž
017D +
+
9_ + +‘
2018 +
’
2019 +
“
201C +
”
201D +
•
2022 +
–
2013 +
—
2014 +
˜
02DC +
™
2122 +
š
0161 +
›
203A +
œ
0153 +
+ž
017E +
Ÿ
0178 +
A_ +NBSP +¡ +¢ +£ +¤ +¥ +¦ +§ +¨ +© +ª +« +¬ +SHY +® +¯ +
B_ +° +± +² +³ +´ +µ + +· +¸ +¹ +º +» +¼ +½ +¾ +¿ +
C_ +À +Á +Â +Ã +Ä +Å +Æ +Ç +È +É +Ê +Ë +Ì +Í +Î +Ï +
D_ +Ð +Ñ +Ò +Ó +Ô +Õ +Ö +× +Ø +Ù +Ú +Û +Ü +Ý +Þ +ß +
E_ +à +á +â +ã +ä +å +æ +ç +è +é +ê +ë +ì +í +î +ï +
F_ +ð +ñ +ò +ó +ô +õ +ö +÷ +ø +ù +ú +û +ü +ý +þ +ÿ +
diff --git a/code_pages/wcp1253.html b/code_pages/wcp1253.html new file mode 100644 index 0000000..92e707f --- /dev/null +++ b/code_pages/wcp1253.html @@ -0,0 +1,856 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1253[3][1][8][9][10][11] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ + +‚ +ƒ +„ +… +† +‡ + +‰ + +‹ + + + + +
9x + +‘ +’ +“ +” +• +– +— + +™ + +› + + + + +
Ax +NBSP +΅ +Ά +£ +¤ +¥ +¦ +§ +¨ +© + +« +¬ +SHY +® +― +
Bx +° +± +² +³ +΄ +µ + +· +Έ +Ή +Ί +» +Ό +½ +Ύ +Ώ +
Cx +ΐ +Α +Β +Γ +Δ +Ε +Ζ +Η +Θ +Ι +Κ +Λ +Μ +Ν +Ξ +Ο +
Dx +Π +Ρ + +Σ +Τ +Υ +Φ +Χ +Ψ +Ω +Ϊ +Ϋ +ά +έ +ή +ί +
Ex +ΰ +α +β +γ +δ +ε +ζ +η +θ +ι +κ +λ +μ +ν +ξ +ο +
Fx +π +ρ +ς +σ +τ +υ +φ +χ +ψ +ω +ϊ +ϋ +ό +ύ +ώ + +
diff --git a/code_pages/wcp1254.html b/code_pages/wcp1254.html new file mode 100644 index 0000000..e618e45 --- /dev/null +++ b/code_pages/wcp1254.html @@ -0,0 +1,847 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1254[10][11][12][13][14][15] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ + +‚ +ƒ +„ +… +† +‡ +ˆ +‰ +Š +‹ +Œ + + + +
9x + +‘ +’ +“ +” +• +– +— +˜  +™ +š +› +œ + + +Ÿ +
Ax +NBSP +¡ +¢ +£ +¤ +¥ +¦ +§ +¨ +© +ª +« +¬ +SHY +® +¯ +
Bx +° +± +² +³ +´ +µ + +· +¸ +¹ +º +» +¼ +½ +¾ +¿ +
Cx +À +Á +Â +Ã +Ä +Å +Æ +Ç +È +É +Ê +Ë +Ì +Í +Î +Ï +
Dx +Ğ +Ñ +Ò +Ó +Ô +Õ +Ö +× +Ø +Ù +Ú +Û +Ü +İ +Ş +ß +
Ex +à +á +â +ã +ä +å +æ +ç +è +é +ê +ë +ì +í +î +ï +
Fx +ğ +ñ +ò +ó +ô +õ +ö +÷ +ø +ù +ú +û +ü +ı +ş +ÿ +
diff --git a/code_pages/wcp1255.html b/code_pages/wcp1255.html new file mode 100644 index 0000000..1f0715c --- /dev/null +++ b/code_pages/wcp1255.html @@ -0,0 +1,598 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1255[7][8][9][10][11][12][13] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ + +‚ +ƒ +„ +… +† +‡ +ˆ +‰ + +‹ + + + + +
9x + +‘ +’ +“ +” +• +– +— +˜ +™ + +› + + + + +
Ax +NBSP +¡ +¢ +£ +₪ +¥ +¦ +§ +¨ +© +× +« +¬ +SHY +® +¯ +
Bx +° +± +² +³ +´ +µ + +· +¸ +¹ +÷ +» +¼ +½ +¾ +¿ +
Cx +ְ +ֱ +ֲ +ֳ +ִ +ֵ +ֶ +ַ +ָ + ֹ + ֺ +ֻ +ּ +ֽ +־ +ֿ +
Dx +׀ +ׁ +ׂ +׃ +װ +ױ +ײ +׳ +״ + + + + + + + +
Ex +א +ב +ג +ד +ה +ו +ז +ח +ט +י +ך +כ +ל +ם +מ +ן +
Fx +נ +ס +ע +ף +פ +ץ +צ +ק +ר +ש +ת + + +LRM +RLM + +
diff --git a/code_pages/wcp1256.html b/code_pages/wcp1256.html new file mode 100644 index 0000000..49f48e3 --- /dev/null +++ b/code_pages/wcp1256.html @@ -0,0 +1,854 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1256[8][9][10][11][12][13][14] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ +پ +‚ +ƒ +„ +… +† +‡ +ˆ +‰ +ٹ +‹ +Œ +چ +ژ +ڈ +
9x +گ +‘ +’ +“ +” +• +– +— +ک +™ +ڑ +› +œ +ZWNJ +ZWJ +ں +
Ax +NBSP +، +¢ +£ +¤ +¥ +¦ +§ +¨ +© +ھ +« +¬ +SHY +® +¯ +
Bx +° +± +² +³ +´ +µ + +· +¸ +¹ +؛ +» +¼ +½ +¾ +؟ +
Cx +ہ +ء +آ +أ +ؤ +إ +ئ +ا +ب +ة +ت +ث +ج +ح +خ +د +
Dx +ذ +ر +ز +س +ش +ص +ض +× +ط +ظ +ع +غ +ـ +ف +ق +ك +
Ex +à +ل +â +م +ن +ه +و +ç +è +é +ê +ë +ى +ي +î +ï +
Fx +ً +ٌ +ٍ +َ +ô +ُ +ِ +÷ +ّ +ù +ْ +û +ü +LRM +RLM +ے +
diff --git a/code_pages/wcp1257.html b/code_pages/wcp1257.html new file mode 100644 index 0000000..cf51cc7 --- /dev/null +++ b/code_pages/wcp1257.html @@ -0,0 +1,844 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1257[8][9][10][11][12][13][14] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ + +‚ + +„ +… +† +‡ + +‰ + +‹ + +¨ +ˇ +¸ +
9x + +‘ +’ +“ +” +• +– +— + +™ + +› + +¯ +˛ + +
Ax +NBSP + +¢ +£ +¤ + +¦ +§ +Ø +© +Ŗ +« +¬ +SHY +® +Æ +
Bx +° +± +² +³ +´ +µ + +· +ø +¹ +ŗ +» +¼ +½ +¾ +æ +
Cx +Ą +Į +Ā +Ć +Ä +Å +Ę +Ē +Č +É +Ź +Ė +Ģ +Ķ +Ī +Ļ +
Dx +Š +Ń +Ņ +Ó +Ō +Õ +Ö +× +Ų +Ł +Ś +Ū +Ü +Ż +Ž +ß +
Ex +ą +į +ā +ć +ä +å +ę +ē +č +é +ź +ė +ģ +ķ +ī +ļ +
Fx +š +ń +ņ +ó +ō +õ +ö +÷ +ų +ł +ś +ū +ü +ż +ž +˙ +
diff --git a/code_pages/wcp1258.html b/code_pages/wcp1258.html new file mode 100644 index 0000000..aba4b99 --- /dev/null +++ b/code_pages/wcp1258.html @@ -0,0 +1,857 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Windows-1258[5][6][7][8][9][10] +
+0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F +
0x +NUL +SOH +STX +ETX +EOT +ENQ +ACK +BEL +BS +HT +LF +VT +FF +CR +SO +SI +
1x +DLE +DC1 +DC2 +DC3 +DC4 +NAK +SYN +ETB +CAN +EM +SUB +ESC +FS +GS +RS +US +
2x + SP  +! +" +# +$ +% +& +' +( +) +* ++ +, +- +. +/ +
3x +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +: +; +< += +> +? +
4x +@ +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +
5x +P +Q +R +S +T +U +V +W +X +Y +Z +[ +\ +] +^ +_ +
6x +` +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +
7x +p +q +r +s +t +u +v +w +x +y +z +{ +| +} +~ +DEL +
8x +€ + +‚ +ƒ +„ +… +† +‡ +ˆ +‰ + +‹ +Œ + + + +
9x + +‘ +’ +“ +” +• +– +— +˜ +™ + +› +œ + + +Ÿ +
Ax +NBSP +¡ +¢ +£ +¤ +¥ +¦ +§ +¨ +© +ª +« +¬ +SHY +® +¯ +
Bx +° +± +² +³ +´ +µ + +· +¸ +¹ +º +» +¼ +½ +¾ +¿ +
Cx +À +Á +Â +Ă +Ä +Å +Æ +Ç +È +É +Ê +Ë +◌̀ +Í +Î +Ï +
Dx +Đ +Ñ +◌̉ +Ó +Ô +Ơ +Ö +× +Ø +Ù +Ú +Û +Ü +Ư +◌̃ +ß +
Ex +à +á +â +ă +ä +å +æ +ç +è +é +ê +ë +◌́ +í +î +ï +
Fx +đ +ñ +◌̣ +ó +ô +ơ +ö +÷ +ø +ù +ú +û +ü +ư +₫ +ÿ +
  Differences from Windows-1252
+
diff --git a/device/device.go b/device/device.go new file mode 100644 index 0000000..7e3d1d6 --- /dev/null +++ b/device/device.go @@ -0,0 +1,9 @@ +package device + +type WriteableDevice interface { + Write(data []byte) (int, error) +} + +type PrinterDevice struct { + Device WriteableDevice +} diff --git a/device/socketDevice.go b/device/socketDevice.go new file mode 100644 index 0000000..b28538b --- /dev/null +++ b/device/socketDevice.go @@ -0,0 +1,27 @@ +package device + +import ( + "errors" + "fmt" + "net" +) + +type PrinterSocket struct { + Host string + Port string +} + +func (p *PrinterSocket) Write(data []byte) (int, error) { + conn, err := net.Dial("tcp", p.Host+":"+p.Port) + if err != nil { + errStr := fmt.Sprintf("Error: %s", err) + return 0, errors.New(errStr) + } + defer conn.Close() + + written, err := conn.Write(data) + if err != nil { + fmt.Println("ERROR: ", err) + } + return written, err +} diff --git a/device/usbDevice.go b/device/usbDevice.go new file mode 100644 index 0000000..fb77289 --- /dev/null +++ b/device/usbDevice.go @@ -0,0 +1,19 @@ +package device + +import ( + "os" +) + +type PrinterUSB struct { + Path string +} + +func (p *PrinterUSB) Write(data []byte) (int, error) { + printer, err := os.OpenFile(p.Path, os.O_WRONLY, 0666) + if err != nil { + panic(err) + } + defer printer.Close() + + return printer.Write(data) +} diff --git a/encoding/encodings.go b/encoding/encodings.go new file mode 100644 index 0000000..63cc525 --- /dev/null +++ b/encoding/encodings.go @@ -0,0 +1,76 @@ +package encodings + +import ( + "unicode/utf8" +) + +type Parser struct { + Charmap map[int]PrinterChar +} + +// charSize returns the number of bits on given char in UTF-8 +func charSize(b byte) int { + toRet := -1 + + if b>>7 == 0b0 { + toRet = 1 + } else if b>>5 == 0b110 { + toRet = 2 + } else if b>>4 == 0b1110 { + toRet = 3 + } else if b>>3 == 0b11110 { + toRet = 4 + } else if b>>2 == 0b111110 { + toRet = 5 + } else if b>>1 == 0b1111110 { + toRet = 6 + } + + return toRet +} + +// Initialize the charmap +func (p *Parser) Initialize() { + p.Charmap = buildTables() +} + +// process will replace unicode characters of the message by the correct +// character of the correct code page for the thermal printer to print +func (p *Parser) Process(m string) []byte { + message := make([]byte, 0) + for k := 0; k < len([]byte(m)); k++ { + size := charSize(m[k]) + + toAppend := []byte{'X'} + if size == 1 { + // Check if its an escape sequence + if int(m[k]) == '\\' { + if int(m[k+1]) == 'n' { + toAppend = []byte{0x0A} + } else if int(m[k+1]) == 't' { + toAppend = []byte{0x09} + } + k += 1 + } else { + toAppend = []byte{m[k]} + } + } else { + char, _ := utf8.DecodeRune([]byte(m[k : k+(size)])) + _, ok := p.Charmap[int(char)] + if ok { + toAppend = []byte{ + 0x1B, + 0x74, + byte(p.Charmap[int(char)].Table), + byte(p.Charmap[int(char)].Hex), + } + } + + k += (size - 1) + } + + message = append(message, toAppend...) + } + + return message +} diff --git a/encoding/encodings_test.go b/encoding/encodings_test.go new file mode 100644 index 0000000..7413fe1 --- /dev/null +++ b/encoding/encodings_test.go @@ -0,0 +1,68 @@ +package encodings + +import ( + "bytes" + "testing" + // "github.com/stretchr/testify/mock" +) + +func TestProcessWithASCII(t *testing.T) { + data := "m" + expect := []byte("m") + + var p Parser + res := p.Process(data) + + if !bytes.Equal(res, expect) { + t.Errorf("%x is different of %x\n", res, expect) + } +} + +func TestProcessWithUTF8(t *testing.T) { + data := "€" + expect := []byte{0x1B, 0x74, 0x10, 0x80} + + var p Parser + p.Initialize() + res := p.Process(data) + + if !bytes.Equal(res, expect) { + t.Errorf("%x is different of %x\n", res, expect) + } +} + +func TestProcessUnavailableChar(t *testing.T) { + data := "�" + expect := []byte("X") + + var p Parser + res := p.Process(data) + + if !bytes.Equal(res, expect) { + t.Errorf("%x is different of %x\n", res, expect) + } +} + +func TestProcessNewLineChar(t *testing.T) { + data := "\\n" + expect := []byte{0x0A} + + var p Parser + res := p.Process(data) + + if !bytes.Equal(res, expect) { + t.Errorf("%x is different of %x\n", res, expect) + } +} + +func TestProcessNewTabChar(t *testing.T) { + data := "\\t" + expect := []byte{0x09} + + var p Parser + res := p.Process(data) + + if !bytes.Equal(res, expect) { + t.Errorf("%x is different of %x\n", res, expect) + } +} diff --git a/encoding/escposTables.go b/encoding/escposTables.go new file mode 100644 index 0000000..e709f30 --- /dev/null +++ b/encoding/escposTables.go @@ -0,0 +1,111 @@ +package encodings + +import ( + "encoding/json" + "fmt" + "os" + "strconv" + "unicode/utf8" + + iconv "github.com/djimenez/iconv-go" +) + +var ( + CAPABILITES = "/home/esilva/Desktop/projetos/escpos-printer-db/dist/capabilities.json" +) + +type PrinterEncodings struct { + IconvName string `json:"iconv"` + Data []string `json:"data"` +} + +type PrinterProfile struct { + CodePages map[string]string `json:"codePages"` + Name string `json:"name"` +} + +type Capabilites struct { + Profiles map[string]PrinterProfile `json:"profiles"` + Encodings map[string]PrinterEncodings `json:"encodings"` +} + +type PrinterChar struct { + Table int + Hex int + Utf string +} + +func buildTables() map[int]PrinterChar { + capabilities := loadCapabilities() + + data := make(map[int]PrinterChar) + for n, enc := range capabilities.Profiles["HZ-8360"].CodePages { + // Check if code page is present in the available encodings + _, ok := capabilities.Encodings[enc] + if ok && len(capabilities.Encodings[enc].IconvName) > 0 { + // Open a new iconv converter for CP037 to UTF-8 + conv, err := iconv.NewConverter(enc, "UTF-8") + if err != nil { + fmt.Printf("Error: %v\n", err) + return nil + } + defer conv.Close() + + // Iterate over all byte values (128-255) and convert them to UTF-8 + for i := 128; i < 256; i++ { + // Convert byte value to UTF-8 string + in := []byte{byte(i)} + out := make([]byte, 4) + _, _, err := conv.Convert(in, out) + + // This usually happens when the table location is empty + if err != nil { + out = []byte(" ") + } + + // Transform it into a rune + char, _ := utf8.DecodeRune(out) + tableNum, _ := strconv.Atoi(n) + + // Create the new char + newChar := PrinterChar{ + Table: tableNum, + Hex: i, + Utf: string(out), + } + + // If the char is already present we only attribute the current char + // if the table num is lower + _, ok := data[int(char)] + if ok && data[int(char)].Table > tableNum { + data[int(char)] = newChar + } + + // If its not present we just add it + if !ok { + data[int(char)] = newChar + } + + } + } + } + + return data +} + +func loadCapabilities() Capabilites { + file, err := os.ReadFile(CAPABILITES) + if err != nil { + fmt.Println("failed to open charmap: ", err) + panic("") + } + + var c Capabilites + err = json.Unmarshal([]byte(file), &c) + if err != nil { + fmt.Println("failed to unmarshal: ", err) + panic("") + } + + return c +} diff --git a/encoding/visualization.go b/encoding/visualization.go new file mode 100644 index 0000000..485f17e --- /dev/null +++ b/encoding/visualization.go @@ -0,0 +1,49 @@ +package encodings + +import ( + "fmt" + "unicode/utf8" + + iconv "github.com/djimenez/iconv-go" +) + +func PrintTable(table string) { + defChar := " " + + // Open a new iconv converter for CP037 to UTF-8 + conv, err := iconv.NewConverter(table, "UTF-8") + if err != nil { + fmt.Printf("Error: %v\n", err) + return + } + defer conv.Close() + + // Iterate over all byte values (0-255) and convert them to UTF-8 + counter := 0 + for i := 128; i < 256; i++ { + // Convert byte value to UTF-8 string + + in := []byte{byte(i)} + out := make([]byte, 4) + _, _, err := conv.Convert(in, out) + + if err != nil { + out = []byte(defChar) + } + + // We have to transform out into a rune + char, _ := utf8.DecodeRune(out) + + fmt.Printf("[%c] ", char) + counter++ + if counter == 16 { + counter = 0 + fmt.Printf("\n") + } + } +} + +func ShowAll() { + tables := buildTables() + fmt.Println(tables) +} diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a4b14a4 --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module thermalPrinter + +go 1.22.2 + +require ( + github.com/djimenez/iconv-go v0.0.0-20160305225143-8960e66bd3da + github.com/spf13/cobra v1.8.0 +) + +require ( + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..e4f3efa --- /dev/null +++ b/go.sum @@ -0,0 +1,12 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/djimenez/iconv-go v0.0.0-20160305225143-8960e66bd3da h1:0qwwqQCLOOXPl58ljnq3sTJR7yRuMolM02vjxDh4ZVE= +github.com/djimenez/iconv-go v0.0.0-20160305225143-8960e66bd3da/go.mod h1:ns+zIWBBchgfRdxNgIJWn2x6U95LQchxeqiN5Cgdgts= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go new file mode 100644 index 0000000..0c4940b --- /dev/null +++ b/main.go @@ -0,0 +1,15 @@ +/* + Copyright © 2024 Eduardo Silva +*/ + +package main + +import "thermalPrinter/cmd" + +func main() { + cmd.Execute() + + // This strings fails to print on ҳ and ԥ + // Вериовкин иҳаԥы + // � +} diff --git a/thermalPrinter/thermalPrinter.go b/thermalPrinter/thermalPrinter.go new file mode 100644 index 0000000..5421cc3 --- /dev/null +++ b/thermalPrinter/thermalPrinter.go @@ -0,0 +1,42 @@ +package thermalprinter + +import ( + "sync" + + "thermalPrinter/device" + encodings "thermalPrinter/encoding" +) + +var ( + instance *TP + once sync.Once +) + +type TP struct { + TextProcessor encodings.Parser + Device device.WriteableDevice +} + +func (p *TP) Print(message string) { + processed := p.TextProcessor.Process(message) + p.Device.Write(processed) +} + +func GetInstance(customDev device.WriteableDevice) *TP { + once.Do(func() { + var p encodings.Parser + p.Initialize() + + devSocket := device.PrinterSocket{ + Host: "", + Port: "", + } + + instance = &TP{ + Device: &devSocket, + TextProcessor: p, + } + }) + + return instance +}