Also work around buggy implementations of strfmon() that do not copy
complete multibyte sequences that may be part of a locale's
mon_thousands_sep, thousands_sep, mon_decimal_point or decimal_point.
Current and previous versions of ISO/IEC 9945-1 (POSIX), particularly SUSv3
(2001) and SUSv4 (2008), require strfmon() to return rather meaningless
strings when used with the POSIX "C" locale. In particular, the standard
POSIX locale does not define a currency symbol, a monetary radix symbol
(decimal point) or a negative sign. This means strfmon(..., "%n", -123.45)
is supposed to produce "12345" instead of something like "$-123.45"!
The new xstrfmon() overcomes these limitations by using snprintf() as
appropriate.
The function wctob() returns an int that can be -1; a conversion to
unsigned char will make that value 0xFF. Although the "if" statement
still works in this case, we should be more diligent in our programming.
The latest versions of the GNU Compiler Collection complain about signed
and unsigned integer comparisons when run with the "-Wextra" flag. Keep
those compilers happy.
In the past, GNU tools used quotes `like this'. Modern practice is to
use quotes 'like this'. Update Star Traders to follow this newer
standard, including all PO files.
The %lc format is actually of type wint_t, according to printf(3), not
wchar_t, even though these are of the same underlying type on most (all?)
platforms.
Wide-char character constants is not strictly needed for most (all?)
modern C compilers, as ASCII maps to wchar_t directly (as long as
__STDC_ISO_10646__ is defined). However, it doesn't hurt to be pedantic!
Move the keycode_company, printable_map_val, chtype_map_val,
keycode_game_move, printable_game_move and chtype_game_move global
variables to intf.c and intf.h.
Convert all input routines, and most internal strings, to use
wide-character functions. All extended characters are supported,
including those having column widths of zero (eg, combining characters),
one (eg, normal Western characters) and two (eg, many East Asian
characters). This was quite a major undertaking!
The xwcrtomb() and xmbstowcs() functions replace illegal characters with
EILSEQ_REPL ('?'). Adjust other functions, particularly mkchstr() and
friends, to suit.
If the background has A_REVERSE, then A_NORMAL will have no effect. For
that reason, specify A_NORMAL as the default background after creating a
new window.