Skip to content
Snippets Groups Projects
Commit fbada04a authored by rswindell's avatar rswindell
Browse files

Added ascii_str() function (translates extended ASCII chars).

parent b46af7c2
No related branches found
No related tags found
No related merge requests found
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment