Subversion Repositories HelenOS

Rev

Rev 4199 | Rev 4208 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4199 Rev 4200
Line 82... Line 82...
82
         * of string
82
         * of string
83
         */
83
         */
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);
87
            wchar_t uc = chr_decode(str, &index, size);
88
 
88
 
89
            if (!utf8_encode(uc, data->dst, &data->len, data->size - 1))
89
            if (!chr_encode(uc, data->dst, &data->len, data->size - 1))
90
                break;
90
                break;
91
        }
91
        }
92
       
92
       
93
        /* Put trailing zero at end, but not count it
93
        /* Put trailing zero at end, but not count it
94
         * into data->len so it could be rewritten next time
94
         * into data->len so it could be rewritten next time
Line 144... Line 144...
144
            data->dst[data->size - 1] = 0;
144
            data->dst[data->size - 1] = 0;
145
            data->len = data->size;
145
            data->len = data->size;
146
            return ((int) size);
146
            return ((int) size);
147
        }
147
        }
148
       
148
       
149
        if (!utf8_encode(str[index], data->dst, &data->len, data->size - 1))
149
        if (!chr_encode(str[index], data->dst, &data->len, data->size - 1))
150
            break;
150
            break;
151
       
151
       
152
        index++;
152
        index++;
153
    }
153
    }
154
   
154