q2c: Use new subc_list_error() to report too many subcommands.
[pspp-builds.git] / src / language / dictionary / mrsets.c
index 8497a059ca857f11344beaa414f987b1e9d48223..2f7c8f6d29ea1601cb23bb7d0b78048dc0eb014a 100644 (file)
@@ -205,14 +205,12 @@ parse_group (struct lexer *lexer, struct dictionary *dict,
 
   if (mrset->name == NULL)
     {
-      msg (SE, _("Required %s specification missing from %s subcommand."),
-           "NAME", subcommand_name);
+      lex_spec_missing (lexer, subcommand_name, "NAME");
       goto error;
     }
   else if (mrset->n_vars == 0)
     {
-      msg (SE, _("Required %s specification missing from %s subcommand."),
-           "VARIABLES", subcommand_name);
+      lex_spec_missing (lexer, subcommand_name, "VARIABLES");
       goto error;
     }
 
@@ -221,8 +219,7 @@ parse_group (struct lexer *lexer, struct dictionary *dict,
       /* Check that VALUE is specified and is valid for the VARIABLES. */
       if (!has_value)
         {
-          msg (SE, _("Required %s specification missing from %s subcommand."),
-               "VALUE", subcommand_name);
+          lex_spec_missing (lexer, subcommand_name, "VALUE");
           goto error;
         }
       else if (var_is_alpha (mrset->vars[0]))
@@ -537,8 +534,8 @@ parse_display (struct lexer *lexer, struct dictionary *dict)
   if (n == 0)
     {
       if (dict_get_n_mrsets (dict) == 0)
-        msg (SN, _("The active file dictionary does not contain any multiple "
-                   "response sets."));
+        msg (SN, _("The active dataset dictionary does not contain any "
+                   "multiple response sets."));
       stringi_set_destroy (&mrset_names_set);
       return true;
     }
@@ -579,8 +576,14 @@ parse_display (struct lexer *lexer, struct dictionary *dict)
           if (mrset->width == 0)
             ds_put_format (&details, "%.0f\n", mrset->counted.f);
           else
-            ds_put_format (&details, "`%.*s'\n", mrset->width,
-                           value_str (&mrset->counted, mrset->width));
+            {
+              const uint8_t *raw = value_str (&mrset->counted, mrset->width);
+              char *utf8 = recode_string ("UTF-8", dict_get_encoding (dict),
+                                          CHAR_CAST (const char *, raw),
+                                          mrset->width);
+              ds_put_format (&details, "`%s'\n", utf8);
+              free (utf8);
+            }
           ds_put_format (&details, "%s: %s\n", _("Category label source"),
                          (mrset->cat_source == MRSET_VARLABELS
                           ? _("Variable labels")