Commit 832e116a authored by Raymond Toy's avatar Raymond Toy

Merge branch 'issue-100-ldb-base-char-printing' into 'master'

ldb prints out Unicode characters

See merge request cmucl/cmucl!67
parents ef9fc1bc 19f274f0
......@@ -212,12 +212,15 @@ static void
brief_otherimm(lispobj obj)
{
int type, c, idx;
char buffer[10];
type = TypeOf(obj);
switch (type) {
case type_BaseChar:
c = (obj >> 8) & 0xff;
/*
* A base-char should only be 16 bits long now. But
* sometimes it uses all 24. So just grab all the bits.
*/
c = (obj >> 8) & 0xfffff;
switch (c) {
case '\0':
printf("#\\Null");
......@@ -228,20 +231,35 @@ brief_otherimm(lispobj obj)
case '\b':
printf("#\\Backspace");
break;
case '\11':
printf("#\\Tab");
break;
case '\13':
printf("#\\Vt");
break;
case '\15':
printf("#\\Return");
break;
case '\33':
printf("#\\Escape");
break;
case '\40':
printf("#\\Space");
break;
case '\177':
printf("#\\Delete");
break;
default:
strcpy(buffer, "#\\");
if (c >= 128) {
strcat(buffer, "m-");
c -= 128;
}
if (c < 32) {
strcat(buffer, "c-");
c += '@';
}
printf("%s%c", buffer, c);
/* Just print out the code value */
printf("#\\u+%04X", c);
} else if (c < 32) {
/* Print it out as a control character */
printf("#\\^%c", c + '@');
} else {
/* Plain ASCII character */
printf("#\\%c", c);
}
break;
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment