From fbada04ae834f34f592753f75b9aa611ba3de6b2 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Sun, 15 Apr 2001 16:47:00 +0000 Subject: [PATCH] Added ascii_str() function (translates extended ASCII chars). --- src/sbbs3/con_out.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/sbbs3/con_out.cpp b/src/sbbs3/con_out.cpp index 7e4ce20495..10e1686c71 100644 --- a/src/sbbs3/con_out.cpp +++ b/src/sbbs3/con_out.cpp @@ -46,10 +46,24 @@ /***************************************************/ /* Seven bit table for EXASCII to ASCII conversion */ /***************************************************/ -const char *sbtbl="CUeaaaaceeeiiiAAEaAooouuyOUcLYRfaiounNao?--24!<>" +static const char *sbtbl="CUeaaaaceeeiiiAAEaAooouuyOUcLYRfaiounNao?--24!<>" "###||||++||++++++--|-+||++--|-+----++++++++##[]#" "abrpEout*ono%0ENE+><rj%=o..+n2* "; +/****************************************************************************/ +/* Convert string from IBM extended ASCII to just ASCII */ +/****************************************************************************/ +char* DLLCALL ascii_str(uchar* str) +{ + size_t i; + + for(i=0;str[i];i++) + if(str[i]&0x80) + str[i]=sbtbl[str[i]^0x80]; /* seven bit table */ + + return((char*)str); +} + /****************************************************************************/ /* Outputs a NULL terminated string locally and remotely (if applicable) */ /* Handles ctrl-a characters */ -- GitLab