- value = xmalloca (value_cnt_from_width (width) * sizeof *value);
- ok = (datasheet_get_value (ds->datasheet, casenum, idx, value, width)
- && data_in (input, LEGACY_NATIVE, fmt->type, 0, 0, 0, value, width)
- && datasheet_put_value (ds->datasheet, casenum, idx, value, width));
+ g_return_val_if_fail (caseproto_get_width (
+ datasheet_get_proto (ds->datasheet), idx) == width,
+ FALSE);
+ value_init (&value, width);
+ ok = (datasheet_get_value (ds->datasheet, casenum, idx, &value)
+ && data_in (input, UTF8, fmt->type, 0, 0, 0,
+ dict->dict, &value, width)
+ && datasheet_put_value (ds->datasheet, casenum, idx, &value));
+ value_destroy (&value, width);