Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8bit characters #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dm-dist-ii/DMC/dmclex.l
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ char tmpstr[YYLMAX + 1], *a, *b;
dmc_exit(1);
}

if ((*a < ' ') && !isspace(*a))
if (0/*(*a < ' ') && !isspace(*a)*/) // by prool: allow full 8bit characters
{
sprintf(buf, "Illegal character ascii %d.",
*a);
Expand Down
14 changes: 14 additions & 0 deletions dm-dist-ii/Mplex/mplex.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ int g_bModeANSI = FALSE;
int g_bModeEcho = FALSE;
int g_bModeRedraw = FALSE;
int g_bModeTelnet = FALSE;
int g_bModeFull8bit = FALSE;


class cConHook *connection_list = NULL;
Expand All @@ -193,6 +194,7 @@ void ShowUsage(char *name)
fprintf(stderr, " -p Player port number, default is 4242.\n");
fprintf(stderr, " -a Internet address of server (localhost default).\n");
fprintf(stderr, " -s Internet port of server (4999 default).\n");
fprintf(stderr, " -u Full 8bit characters for UTF-8, koi8-r, cp1251, etc\n");
exit(0);
}

Expand Down Expand Up @@ -240,6 +242,10 @@ int ParseArg(int argc, char *argv[], struct arg_type *arg)
g_bModeTelnet = TRUE;
break;

case 'u':
g_bModeFull8bit = TRUE;
break;

case 'a':
i++;
Assert(i < argc, "No argument to internet address.");
Expand Down Expand Up @@ -339,8 +345,16 @@ char cConHook::AddInputChar(ubit8 c)
*cp++ = c;
*cp = 0;

if ( g_bModeFull8bit ) // prool: full 8 bit characters support
{
if ((c < ' ') || (c==255) || (m_sSetup.telnet && ((c==0xFD) || (c==0xFE))))
*(cp-1) = 0;
}
else
{
if ((c < ' ') || (c==255) || (m_sSetup.telnet && (c > 127)))
*(cp-1) = 0;
}

return *(cp - 1);
}
Expand Down