variable: Make var_set_label() use the variable's own encoding.
[pspp-builds.git] / src / data / sys-file-reader.c
index 6643b85da2848551cac05a352395e0c7bc9907c5..6a5afff226130937f8ae387019ca538a705a2cee 100644 (file)
@@ -428,10 +428,8 @@ sfm_open_reader (struct file_handle *fh, struct dictionary **dictp,
 
      First, figure out the correct character encoding, because this determines
      how the rest of the header data is to be interpreted. */
-  dict = dict_create ();
-  r->encoding = choose_encoding (r, extensions[EXT_INTEGER],
-                                 extensions[EXT_ENCODING]);
-  dict_set_encoding (dict, r->encoding);
+  dict = dict_create (choose_encoding (r, extensions[EXT_INTEGER],
+                                       extensions[EXT_ENCODING]));
 
   /* These records don't use variables at all. */
   if (document != NULL)
@@ -976,7 +974,7 @@ parse_variable_records (struct sfm_reader *r, struct dictionary *dict,
 
           utf8_label = recode_string_pool ("UTF-8", dict_encoding,
                                            rec->label, -1, r->pool);
-          var_set_label (var, utf8_label, NULL, false);
+          var_set_label (var, utf8_label, false);
         }
 
       /* Set missing values. */