Rev 4180 | Rev 4199 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4180 | Rev 4184 | ||
---|---|---|---|
Line 84... | Line 84... | ||
84 | index_t index = 0; |
84 | index_t index = 0; |
85 | 85 | ||
86 | while (index < size) { |
86 | while (index < size) { |
87 | wchar_t uc = utf8_decode(str, &index, size - 1); |
87 | wchar_t uc = utf8_decode(str, &index, size - 1); |
88 | 88 | ||
89 | if (!utf8_encode(uc, data->dst, &data->len, data->size - 1)) |
89 | if (!utf8_encode(uc, data->dst, &data->len, data->size - 2)) |
90 | break; |
90 | break; |
91 | 91 | ||
92 | data->len++; |
92 | data->len++; |
93 | index++; |
93 | index++; |
94 | } |
94 | } |
Line 147... | Line 147... | ||
147 | data->dst[data->size - 1] = 0; |
147 | data->dst[data->size - 1] = 0; |
148 | data->len = data->size; |
148 | data->len = data->size; |
149 | return ((int) size); |
149 | return ((int) size); |
150 | } |
150 | } |
151 | 151 | ||
152 | if (!utf8_encode(str[index], data->dst, &data->len, data->size - 1)) |
152 | if (!utf8_encode(str[index], data->dst, &data->len, data->size - 2)) |
153 | break; |
153 | break; |
154 | 154 | ||
155 | data->len++; |
155 | data->len++; |
156 | index++; |
156 | index++; |
157 | } |
157 | } |