about summary refs log tree commit diff stats
path: root/src/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/encoding')
-rw-r--r--src/encoding/decoderstream.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/encoding/decoderstream.nim b/src/encoding/decoderstream.nim
index 62e69f7f..51feb85d 100644
--- a/src/encoding/decoderstream.nim
+++ b/src/encoding/decoderstream.nim
@@ -273,8 +273,8 @@ proc decodeBig5(stream: DecoderStream, iq: var seq[uint8],
     if stream.big5lead != 0:
       let lead = uint32(stream.big5lead)
       stream.big5lead = 0
-      let offset = if iq[i] < 0x7F: 0x40u16 else: 0x7E
-      if iq[i] in {0x40u8 .. 0x7Eu8, 0xA1 .. 0xFEu8}:
+      let offset = if iq[i] < 0x7F: 0x40u16 else: 0x62u16
+      if iq[i] in {0x40u8 .. 0x7Eu8, 0xA1u8 .. 0xFEu8}:
         let p = (lead - 0x81) * 157 + uint16(iq[i]) - offset
         template output_two(a, b: uint32) =
           stream.append_codepoint a, oq, olen, n
@@ -288,7 +288,7 @@ proc decodeBig5(stream: DecoderStream, iq: var seq[uint8],
           else: break no_continue
           inc i
           continue
-        if p < Big5Decode.len - Big5DecodeOffset:
+        if p < Big5Decode.len + Big5DecodeOffset:
           let c = Big5Decode[p - Big5DecodeOffset]
           if c != 0:
             stream.append_codepoint c, oq, olen, n
@@ -301,7 +301,7 @@ proc decodeBig5(stream: DecoderStream, iq: var seq[uint8],
         if stream.isend: break
     elif cast[char](iq[i]) in Ascii:
       stream.append_codepoint iq[i], oq, olen, n
-    elif iq[i] in 0x00u8 .. 0xFEu8:
+    elif iq[i] in 0x81u8 .. 0xFEu8:
       stream.big5lead = iq[i]
     else:
       stream.handleError(oq, olen, n)
ystem_overview.rst?h=devel&id=20993047ce05aaa1e7015d0db17995fed829da4a'>^
714c4f0d6 ^

















7c08303fa ^


83ae70cb5 ^
714c4f0d6 ^
7c08303fa ^
714c4f0d6 ^
714c4f0d6 ^





5f08d3939 ^







f3d57761a ^


5f08d3939 ^









714c4f0d6 ^

16d81fa20 ^
714c4f0d6 ^
7c08303fa ^

714c4f0d6 ^

















































7c08303fa ^
714c4f0d6 ^
7c08303fa ^

714c4f0d6 ^

























f3d57761a ^

















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175

                      
                                                                           
                     
 



                                 
                             





                                                                     


                                                                              

















                                                                         


                                                                              
                                                                         
                                                      
                                                            
                                                                               





    







                                                                                             


                                                                                        









                                                                                             

             
                                                                
                           

                                                                               

















































                                                                                              
                                                                           
                                                     

                                                                    

























                                                                             

















                                                                                                  
2
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770