Many operations that involve the names of variables and other entities
in a dictionary depend on the dictionary's encoding, so it is
potentially important to have the encoding set properly when adding
other entities to the dictionary.
I did not check that this fixes an actual bug.
d = dict_create ();
+ /* Set the new dictionary's encoding early so that string length limitations
+ are interpreted correctly. */
+ if ( s->encoding)
+ d->encoding = xstrdup (s->encoding);
+
for (i = 0; i < s->var_cnt; i++)
{
struct variable *sv = s->var[i].var;
for (i = 0; i < s->vector_cnt; i++)
d->vector[i] = vector_clone (s->vector[i], s, d);
- if ( s->encoding)
- d->encoding = xstrdup (s->encoding);
-
dict_set_attributes (d, dict_get_attributes (s));
for (i = 0; i < s->n_mrsets; i++)