+#if HAVE_LANGINFO_CODESET
+/*
+ * This program first appeared in ncurses in January 1995. At that point, the
+ * Linux console was able to display CP437 graphic characters, e.g., in the
+ * range 0-31. As of 2016, most Linux consoles are running with the UTF-8
+ * (partial) support. Incidentally, that makes all of the cards diamonds.
+ */
+static void
+use_pc_display(void)
+{
+ char *check = nl_langinfo(CODESET);
+ if (!strcmp(check, "UTF-8")) {
+#if USE_WIDEC_SUPPORT
+ suits = uglyphs;
+#endif
+ } else {
+#if HAVE_TIGETSTR
+ if (!strcmp(check, "IBM437") ||
+ !strcmp(check, "CP437") ||
+ !strcmp(check, "IBM850") ||
+ !strcmp(check, "CP850")) {
+ char *smacs = tigetstr("smacs");
+ char *smpch = tigetstr("smpch");
+ /*
+ * The ncurses library makes this check to decide whether to allow
+ * the alternate character set for the (normally) nonprinting codes.
+ */
+ if (smacs != 0 && smpch != 0 && !strcmp(smacs, smpch)) {
+ suits = glyphs;
+ }
+ }
+#endif
+ }
+}
+#else
+#define use_pc_display() /* nothing */
+#endif /* HAVE_LANGINFO_CODESET */
+