Remove experimental Unicode support.
This reverts commit 7f0f43e6f9 and some related
subsequent commits.
This compiles, but I have not done extensive testing.
Conflicts:
include/config.h
include/decl.h
include/extern.h
include/global.h
include/tradstdc.h
include/wintty.h
src/drawing.c
src/files.c
src/hacklib.c
src/mapglyph.c
src/options.c
sys/winnt/nttty.c
win/tty/getline.c
win/tty/topl.c
win/tty/wintty.c
This commit is contained in:
@@ -64,6 +64,9 @@ int GUILaunched;
|
||||
extern int redirect_stdout;
|
||||
static BOOL FDECL(CtrlHandler, (DWORD));
|
||||
|
||||
/* Flag for whether unicode is supported */
|
||||
static boolean has_unicode;
|
||||
|
||||
#ifdef PORT_DEBUG
|
||||
static boolean display_cursor_info = FALSE;
|
||||
#endif
|
||||
@@ -146,12 +149,6 @@ static void NDECL(init_ttycolor);
|
||||
# endif
|
||||
static void NDECL(really_move_cursor);
|
||||
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
void FDECL(xputc_core,(NHWCHAR_P));
|
||||
#else
|
||||
void FDECL(xputc_core,(int));
|
||||
#endif
|
||||
|
||||
#define MAX_OVERRIDES 256
|
||||
unsigned char key_overrides[MAX_OVERRIDES];
|
||||
|
||||
@@ -199,14 +196,11 @@ const char *s;
|
||||
void
|
||||
setftty()
|
||||
{
|
||||
static int cp = 0;
|
||||
if (!cp) cp = GetConsoleOutputCP();
|
||||
/* SetConsoleOutputCP(1250); */
|
||||
#ifdef CHANGE_COLOR
|
||||
if (altered_palette) adjust_palette();
|
||||
#endif
|
||||
start_screen();
|
||||
iflags.unicodecapable = ((GetVersion() & 0x80000000) == 0);
|
||||
has_unicode = ((GetVersion() & 0x80000000) == 0);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -457,61 +451,24 @@ int x,y;
|
||||
ttyDisplay->cury = y;
|
||||
}
|
||||
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
#define T(x) L##x
|
||||
#else
|
||||
#define T(x) x
|
||||
#endif
|
||||
|
||||
void
|
||||
xputc_core(ich)
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
nhwchar ich;
|
||||
#else
|
||||
int ich;
|
||||
#endif
|
||||
xputc_core(ch)
|
||||
char ch;
|
||||
{
|
||||
static uchar c[2] = {0,0};
|
||||
char ch = (char)ich;
|
||||
|
||||
#if 0
|
||||
/*EURO symbol*/
|
||||
if (ich == 0x20AC) {
|
||||
if (!c[0]) {
|
||||
wchar_t t[2]={0x20ac, 0x0000};
|
||||
int cp = GetConsoleOutputCP();
|
||||
(void) WideCharToMultiByte(cp,
|
||||
0,
|
||||
t, 1,
|
||||
c, 2,
|
||||
(LPCSTR)0,
|
||||
(LPBOOL)0);
|
||||
}
|
||||
ich = (nhwchar)c[0];
|
||||
}
|
||||
#endif
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
switch(ich) {
|
||||
#else
|
||||
switch(ch) {
|
||||
#endif
|
||||
case T('\n'):
|
||||
case '\n':
|
||||
cursor.Y++;
|
||||
/* fall through */
|
||||
case T('\r'):
|
||||
case '\r':
|
||||
cursor.X = 1;
|
||||
break;
|
||||
case T('\b'):
|
||||
case '\b':
|
||||
cursor.X--;
|
||||
break;
|
||||
default:
|
||||
WriteConsoleOutputAttribute(hConOut,&attr,1,
|
||||
cursor,&acount);
|
||||
if (iflags.unicodedisp) {
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
WriteConsoleOutputCharacterW(hConOut,&ich,1,
|
||||
cursor,&ccount);
|
||||
#else
|
||||
if (has_unicode) {
|
||||
/* Avoid bug in ANSI API on WinNT */
|
||||
WCHAR c2[2];
|
||||
int rc;
|
||||
@@ -522,7 +479,6 @@ int ich;
|
||||
c2, 2);
|
||||
WriteConsoleOutputCharacterW(hConOut,c2,rc,
|
||||
cursor,&ccount);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
WriteConsoleOutputCharacterA(hConOut,&ch,1,
|
||||
@@ -534,11 +490,7 @@ int ich;
|
||||
|
||||
void
|
||||
xputc(ch)
|
||||
#ifdef UNICODE_WIDEWINPORT
|
||||
nhwchar ch;
|
||||
#else
|
||||
int ch;
|
||||
#endif
|
||||
char ch;
|
||||
{
|
||||
cursor.X = ttyDisplay->curx;
|
||||
cursor.Y = ttyDisplay->cury;
|
||||
@@ -569,8 +521,8 @@ const char *s;
|
||||
* for win32. It is used for glyphs only, not text.
|
||||
*/
|
||||
void
|
||||
g_putch(in_sym)
|
||||
int in_sym;
|
||||
g_putch(in_ch)
|
||||
int in_ch;
|
||||
{
|
||||
/* CP437 to Unicode mapping according to the Unicode Consortium */
|
||||
static const WCHAR cp437[] =
|
||||
@@ -608,18 +560,12 @@ int in_sym;
|
||||
0x2261, 0x00b1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00f7, 0x2248,
|
||||
0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x25a0, 0x00a0
|
||||
};
|
||||
uchar ch = (uchar)in_sym;
|
||||
unsigned char ch = (unsigned char)in_ch;
|
||||
|
||||
cursor.X = ttyDisplay->curx;
|
||||
cursor.Y = ttyDisplay->cury;
|
||||
WriteConsoleOutputAttribute(hConOut,&attr,1,cursor,&acount);
|
||||
#ifdef UNICODE_DRAWING
|
||||
if (symset[currentgraphics].name &&
|
||||
symset[currentgraphics].unicode && iflags.unicodedisp)
|
||||
WriteConsoleOutputCharacterW(hConOut,(LPCWSTR)&in_sym,1,cursor,&ccount);
|
||||
else
|
||||
#endif
|
||||
if (SYMHANDLING(H_IBM))
|
||||
if (has_unicode)
|
||||
WriteConsoleOutputCharacterW(hConOut,&cp437[ch],1,cursor,&ccount);
|
||||
else
|
||||
WriteConsoleOutputCharacterA(hConOut,&ch,1,cursor,&ccount);
|
||||
|
||||
Reference in New Issue
Block a user