sys-file-info: Add IBM850 and DIN_66003 encodings.
[pspp] / src / language / dictionary / sys-file-info.c
index 05f9be91fbd4224b87f9789597d4a9d09d292f24..f96fa167a5b98b6f9f6df393655e7663ee9d2aed 100644 (file)
@@ -764,10 +764,10 @@ display_vectors (const struct dictionary *dict, int sorted)
 \f
 /* Encoding analysis. */
 
-/* This list of encodings is taken from http://encoding.spec.whatwg.org/, as
-   retrieved February 2014.  Encodings not supported by glibc and encodings
-   relevant only to HTML have been removed. */
 static const char *encoding_names[] = {
+  /* These encodings are from http://encoding.spec.whatwg.org/, as retrieved
+     February 2014.  Encodings not supported by glibc and encodings relevant
+     only to HTML have been removed. */
   "utf-8",
   "windows-1252",
   "iso-8859-2",
@@ -800,6 +800,10 @@ static const char *encoding_names[] = {
   "iso-2022-jp",
   "shift_jis",
   "euc-kr",
+
+  /* Added by user request. */
+  "ibm850",
+  "din_66003",
 };
 #define N_ENCODING_NAMES (sizeof encoding_names / sizeof *encoding_names)
 
@@ -1029,7 +1033,7 @@ report_encodings (const struct file_handle *h, const struct sfm_reader *r)
           ds_put_format (&s, "%s, ", encoding_names[j]);
       ds_chomp (&s, ss_cstr (", "));
 
-      tab_text_format (t, 0, i + 1, TAB_RIGHT, "%d", i + 1);
+      tab_text_format (t, 0, i + 1, TAB_RIGHT, "%zu", i + 1);
       tab_text (t, 1, i + 1, TAB_LEFT, ds_cstr (&s));
       ds_destroy (&s);
     }
@@ -1076,7 +1080,7 @@ report_encodings (const struct file_handle *h, const struct sfm_reader *r)
           {
             const char *s = encodings[j].utf8_strings[i] + prefix;
 
-            tab_text_format (t, 1, row, TAB_RIGHT, "%d", j + 1);
+            tab_text_format (t, 1, row, TAB_RIGHT, "%zu", j + 1);
             if (prefix || suffix)
               {
                 size_t len = strlen (s) - suffix;