Może komuś się przyda. Poniżej podaję tabelę z konwersją kodowania z Windows CP1250 do utf8. W tabeli przedstawione są wartości poczególnych bajtów składających się na znak. Wartości są w formacie dziesiętnym (np. do wykorzystania w funkcji chr()) i w formacie szesnastkowym (np. do bezpośredniej konwersji).
Jeśli chcesz użyć warotści w kodzie szesnastkowym do bezpośredniej konwersji to nei zapomnij wyrzucić przecinków. Przykładowo znak \x80
w cp1250 powienien być przekonwertowany na \xe2\x82\xac
w UTF8.
Jeśli chcesz zobaczyć pełną tabelę to zobacz tabelę znaków dla kodowania Windows 1250.
ANSI DECIMAL | UTF8 DECIMAL | ANSI HEX | UTF8 HEX
0 | 0 | 0x0 | 0x0
1 | 1 | 0x1 | 0x1
2 | 2 | 0x2 | 0x2
3 | 3 | 0x3 | 0x3
4 | 4 | 0x4 | 0x4
5 | 5 | 0x5 | 0x5
6 | 6 | 0x6 | 0x6
7 | 7 | 0x7 | 0x7
8 | 8 | 0x8 | 0x8
9 | 9 | 0x9 | 0x9
10 | 10 | 0xa | 0xa
11 | 11 | 0xb | 0xb
12 | 12 | 0xc | 0xc
13 | 13 | 0xd | 0xd
14 | 14 | 0xe | 0xe
15 | 15 | 0xf | 0xf
16 | 16 | 0x10 | 0x10
17 | 17 | 0x11 | 0x11
18 | 18 | 0x12 | 0x12
19 | 19 | 0x13 | 0x13
20 | 20 | 0x14 | 0x14
21 | 21 | 0x15 | 0x15
22 | 22 | 0x16 | 0x16
23 | 23 | 0x17 | 0x17
24 | 24 | 0x18 | 0x18
25 | 25 | 0x19 | 0x19
26 | 26 | 0x1a | 0x1a
27 | 27 | 0x1b | 0x1b
28 | 28 | 0x1c | 0x1c
29 | 29 | 0x1d | 0x1d
30 | 30 | 0x1e | 0x1e
31 | 31 | 0x1f | 0x1f
32 | 32 | 0x20 | 0x20
33 | 33 | 0x21 | 0x21
34 | 34 | 0x22 | 0x22
35 | 35 | 0x23 | 0x23
36 | 36 | 0x24 | 0x24
37 | 37 | 0x25 | 0x25
38 | 38 | 0x26 | 0x26
39 | 39 | 0x27 | 0x27
40 | 40 | 0x28 | 0x28
41 | 41 | 0x29 | 0x29
42 | 42 | 0x2a | 0x2a
43 | 43 | 0x2b | 0x2b
44 | 44 | 0x2c | 0x2c
45 | 45 | 0x2d | 0x2d
46 | 46 | 0x2e | 0x2e
47 | 47 | 0x2f | 0x2f
48 | 48 | 0x30 | 0x30
49 | 49 | 0x31 | 0x31
50 | 50 | 0x32 | 0x32
51 | 51 | 0x33 | 0x33
52 | 52 | 0x34 | 0x34
53 | 53 | 0x35 | 0x35
54 | 54 | 0x36 | 0x36
55 | 55 | 0x37 | 0x37
56 | 56 | 0x38 | 0x38
57 | 57 | 0x39 | 0x39
58 | 58 | 0x3a | 0x3a
59 | 59 | 0x3b | 0x3b
60 | 60 | 0x3c | 0x3c
61 | 61 | 0x3d | 0x3d
62 | 62 | 0x3e | 0x3e
63 | 63 | 0x3f | 0x3f
64 | 64 | 0x40 | 0x40
65 | 65 | 0x41 | 0x41
66 | 66 | 0x42 | 0x42
67 | 67 | 0x43 | 0x43
68 | 68 | 0x44 | 0x44
69 | 69 | 0x45 | 0x45
70 | 70 | 0x46 | 0x46
71 | 71 | 0x47 | 0x47
72 | 72 | 0x48 | 0x48
73 | 73 | 0x49 | 0x49
74 | 74 | 0x4a | 0x4a
75 | 75 | 0x4b | 0x4b
76 | 76 | 0x4c | 0x4c
77 | 77 | 0x4d | 0x4d
78 | 78 | 0x4e | 0x4e
79 | 79 | 0x4f | 0x4f
80 | 80 | 0x50 | 0x50
81 | 81 | 0x51 | 0x51
82 | 82 | 0x52 | 0x52
83 | 83 | 0x53 | 0x53
84 | 84 | 0x54 | 0x54
85 | 85 | 0x55 | 0x55
86 | 86 | 0x56 | 0x56
87 | 87 | 0x57 | 0x57
88 | 88 | 0x58 | 0x58
89 | 89 | 0x59 | 0x59
90 | 90 | 0x5a | 0x5a
91 | 91 | 0x5b | 0x5b
92 | 92 | 0x5c | 0x5c
93 | 93 | 0x5d | 0x5d
94 | 94 | 0x5e | 0x5e
95 | 95 | 0x5f | 0x5f
96 | 96 | 0x60 | 0x60
97 | 97 | 0x61 | 0x61
98 | 98 | 0x62 | 0x62
99 | 99 | 0x63 | 0x63
100 | 100 | 0x64 | 0x64
101 | 101 | 0x65 | 0x65
102 | 102 | 0x66 | 0x66
103 | 103 | 0x67 | 0x67
104 | 104 | 0x68 | 0x68
105 | 105 | 0x69 | 0x69
106 | 106 | 0x6a | 0x6a
107 | 107 | 0x6b | 0x6b
108 | 108 | 0x6c | 0x6c
109 | 109 | 0x6d | 0x6d
110 | 110 | 0x6e | 0x6e
111 | 111 | 0x6f | 0x6f
112 | 112 | 0x70 | 0x70
113 | 113 | 0x71 | 0x71
114 | 114 | 0x72 | 0x72
115 | 115 | 0x73 | 0x73
116 | 116 | 0x74 | 0x74
117 | 117 | 0x75 | 0x75
118 | 118 | 0x76 | 0x76
119 | 119 | 0x77 | 0x77
120 | 120 | 0x78 | 0x78
121 | 121 | 0x79 | 0x79
122 | 122 | 0x7a | 0x7a
123 | 123 | 0x7b | 0x7b
124 | 124 | 0x7c | 0x7c
125 | 125 | 0x7d | 0x7d
126 | 126 | 0x7e | 0x7e
127 | 127 | 0x7f | 0x7f
128 | 226,130,172 | 0x80 | 0xe2,0x82,0xac
129 | not used
130 | 226,128,154 | 0x82 | 0xe2,0x80,0x9a
131 | not used
132 | 226,128,158 | 0x84 | 0xe2,0x80,0x9e
133 | 226,128,166 | 0x85 | 0xe2,0x80,0xa6
134 | 226,128,160 | 0x86 | 0xe2,0x80,0xa0
135 | 226,128,161 | 0x87 | 0xe2,0x80,0xa1
136 | not used
137 | 226,128,176 | 0x89 | 0xe2,0x80,0xb0
138 | 197,160 | 0x8a | 0xc5,0xa0
139 | 226,128,185 | 0x8b | 0xe2,0x80,0xb9
140 | 197,154 | 0x8c | 0xc5,0x9a
141 | 197,164 | 0x8d | 0xc5,0xa4
142 | 197,189 | 0x8e | 0xc5,0xbd
143 | 197,185 | 0x8f | 0xc5,0xb9
144 | not used
145 | 226,128,152 | 0x91 | 0xe2,0x80,0x98
146 | 226,128,153 | 0x92 | 0xe2,0x80,0x99
147 | 226,128,156 | 0x93 | 0xe2,0x80,0x9c
148 | 226,128,157 | 0x94 | 0xe2,0x80,0x9d
149 | 226,128,162 | 0x95 | 0xe2,0x80,0xa2
150 | 226,128,147 | 0x96 | 0xe2,0x80,0x93
151 | 226,128,148 | 0x97 | 0xe2,0x80,0x94
152 | not used
153 | 226,132,162 | 0x99 | 0xe2,0x84,0xa2
154 | 197,161 | 0x9a | 0xc5,0xa1
155 | 226,128,186 | 0x9b | 0xe2,0x80,0xba
156 | 197,155 | 0x9c | 0xc5,0x9b
157 | 197,165 | 0x9d | 0xc5,0xa5
158 | 197,190 | 0x9e | 0xc5,0xbe
159 | 197,186 | 0x9f | 0xc5,0xba
160 | 194,160 | 0xa0 | 0xc2,0xa0
161 | 203,135 | 0xa1 | 0xcb,0x87
162 | 203,152 | 0xa2 | 0xcb,0x98
163 | 197,129 | 0xa3 | 0xc5,0x81
164 | 194,164 | 0xa4 | 0xc2,0xa4
165 | 196,132 | 0xa5 | 0xc4,0x84
166 | 194,166 | 0xa6 | 0xc2,0xa6
167 | 194,167 | 0xa7 | 0xc2,0xa7
168 | 194,168 | 0xa8 | 0xc2,0xa8
169 | 194,169 | 0xa9 | 0xc2,0xa9
170 | 197,158 | 0xaa | 0xc5,0x9e
171 | 194,171 | 0xab | 0xc2,0xab
172 | 194,172 | 0xac | 0xc2,0xac
173 | 194,173 | 0xad | 0xc2,0xad
174 | 194,174 | 0xae | 0xc2,0xae
175 | 197,187 | 0xaf | 0xc5,0xbb
176 | 194,176 | 0xb0 | 0xc2,0xb0
177 | 194,177 | 0xb1 | 0xc2,0xb1
178 | 203,155 | 0xb2 | 0xcb,0x9b
179 | 197,130 | 0xb3 | 0xc5,0x82
180 | 194,180 | 0xb4 | 0xc2,0xb4
181 | 194,181 | 0xb5 | 0xc2,0xb5
182 | 194,182 | 0xb6 | 0xc2,0xb6
183 | 194,183 | 0xb7 | 0xc2,0xb7
184 | 194,184 | 0xb8 | 0xc2,0xb8
185 | 196,133 | 0xb9 | 0xc4,0x85
186 | 197,159 | 0xba | 0xc5,0x9f
187 | 194,187 | 0xbb | 0xc2,0xbb
188 | 196,189 | 0xbc | 0xc4,0xbd
189 | 203,157 | 0xbd | 0xcb,0x9d
190 | 196,190 | 0xbe | 0xc4,0xbe
191 | 197,188 | 0xbf | 0xc5,0xbc
192 | 197,148 | 0xc0 | 0xc5,0x94
193 | 195,129 | 0xc1 | 0xc3,0x81
194 | 195,130 | 0xc2 | 0xc3,0x82
195 | 196,130 | 0xc3 | 0xc4,0x82
196 | 195,132 | 0xc4 | 0xc3,0x84
197 | 196,185 | 0xc5 | 0xc4,0xb9
198 | 196,134 | 0xc6 | 0xc4,0x86
199 | 195,135 | 0xc7 | 0xc3,0x87
200 | 196,140 | 0xc8 | 0xc4,0x8c
201 | 195,137 | 0xc9 | 0xc3,0x89
202 | 196,152 | 0xca | 0xc4,0x98
203 | 195,139 | 0xcb | 0xc3,0x8b
204 | 196,154 | 0xcc | 0xc4,0x9a
205 | 195,141 | 0xcd | 0xc3,0x8d
206 | 195,142 | 0xce | 0xc3,0x8e
207 | 196,142 | 0xcf | 0xc4,0x8e
208 | 196,144 | 0xd0 | 0xc4,0x90
209 | 197,131 | 0xd1 | 0xc5,0x83
210 | 197,135 | 0xd2 | 0xc5,0x87
211 | 195,147 | 0xd3 | 0xc3,0x93
212 | 195,148 | 0xd4 | 0xc3,0x94
213 | 197,144 | 0xd5 | 0xc5,0x90
214 | 195,150 | 0xd6 | 0xc3,0x96
215 | 195,151 | 0xd7 | 0xc3,0x97
216 | 197,152 | 0xd8 | 0xc5,0x98
217 | 197,174 | 0xd9 | 0xc5,0xae
218 | 195,154 | 0xda | 0xc3,0x9a
219 | 197,176 | 0xdb | 0xc5,0xb0
220 | 195,156 | 0xdc | 0xc3,0x9c
221 | 195,157 | 0xdd | 0xc3,0x9d
222 | 197,162 | 0xde | 0xc5,0xa2
223 | 195,159 | 0xdf | 0xc3,0x9f
224 | 197,149 | 0xe0 | 0xc5,0x95
225 | 195,161 | 0xe1 | 0xc3,0xa1
226 | 195,162 | 0xe2 | 0xc3,0xa2
227 | 196,131 | 0xe3 | 0xc4,0x83
228 | 195,164 | 0xe4 | 0xc3,0xa4
229 | 196,186 | 0xe5 | 0xc4,0xba
230 | 196,135 | 0xe6 | 0xc4,0x87
231 | 195,167 | 0xe7 | 0xc3,0xa7
232 | 196,141 | 0xe8 | 0xc4,0x8d
233 | 195,169 | 0xe9 | 0xc3,0xa9
234 | 196,153 | 0xea | 0xc4,0x99
235 | 195,171 | 0xeb | 0xc3,0xab
236 | 196,155 | 0xec | 0xc4,0x9b
237 | 195,173 | 0xed | 0xc3,0xad
238 | 195,174 | 0xee | 0xc3,0xae
239 | 196,143 | 0xef | 0xc4,0x8f
240 | 196,145 | 0xf0 | 0xc4,0x91
241 | 197,132 | 0xf1 | 0xc5,0x84
242 | 197,136 | 0xf2 | 0xc5,0x88
243 | 195,179 | 0xf3 | 0xc3,0xb3
244 | 195,180 | 0xf4 | 0xc3,0xb4
245 | 197,145 | 0xf5 | 0xc5,0x91
246 | 195,182 | 0xf6 | 0xc3,0xb6
247 | 195,183 | 0xf7 | 0xc3,0xb7
248 | 197,153 | 0xf8 | 0xc5,0x99
249 | 197,175 | 0xf9 | 0xc5,0xaf
250 | 195,186 | 0xfa | 0xc3,0xba
251 | 197,177 | 0xfb | 0xc5,0xb1
252 | 195,188 | 0xfc | 0xc3,0xbc
253 | 195,189 | 0xfd | 0xc3,0xbd
254 | 197,163 | 0xfe | 0xc5,0xa3
255 | 203,153 | 0xff | 0xcb,0x99
Kod w języku python słuzący do wygenerowania tej tablicy (jesli komuś się przyda) wygląda tak:
import sys # redirect print to file fp = open('output.txt', 'w') std = sys.stdout sys.stdout = fp # create output print 'ANSI DECIMAL | UTF8 DECIMAL | ANSI HEX | UTF8 HEX' for i in xrange(256): try: #convert char with decimal code "i" from cp1250 to utf8 utfchar = chr(i).decode('cp1250').encode('utf8') lstdec = [] lsthex = [] for b in utfchar: lstdec.append(str(ord(b))) # utf-decimal lsthex.append(str(hex(ord(b)))) # utf-hex print ' %-11s | %-13s| %-9s| %s' % (i, ','.join(lstdec), hex(i), ','.join(lsthex)) except: print ' %-11s | not used ' % i # close file pointer std = sys.stdout fp.close()
Jeśli nie chcesz wyrzucać danych do pliku ale na ekran wystarczy, że zakomentujesz linijkę sys.stdout = fp
.