Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ Compiling the server
➜ Handling Unicode in SMAUG
Handling Unicode in SMAUG
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Tue 10 Feb 2004 03:48 AM (UTC) |
Message
| I found when testing my Unicode enhancements to MUSHclient that a heap of things would not work correctly. For instance, typing:
think (some Unicode string)
would result in the MUD replying:
Think what?
A bit of research led to the following lines in function read_from_buffer in comm.c ...
if ( d->inbuf[i] == '\b' && k > 0 )
--k;
else if ( isascii(d->inbuf[i]) && isprint(d->inbuf[i]) )
d->incomm[k++] = d->inbuf[i];
This seems to be discarding any input that is not 7-bit ASCII, and is also redundant - why check for "isascii" AND "isprint"?
I suggest this change:
if ( d->inbuf[i] == '\b' && k > 0 )
--k;
else if (isprint(d->inbuf[i]))
d->incomm[k++] = d->inbuf[i];
This lets printable characters through, which is what you really want.
After making that change you could "think" or "say" Unicode strings.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
5,543 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top