Re: Accents for Mud

From: Sergey S. Khoroshavin (sergey@pve.vsu.ru)
Date: 06/05/01


>Good. So far I did not obtain to decide me problem, If in case that they
>alguem already has the made code, please it orders for min, I will be
>grateful.  I am needing Very...

I had problem with making my MUD understand russian symbols. I've solved it
and I think that you could be interested in it.

Do the following:
1) In utils.h

find:

void point_update(void);
void update_pos(struct char_data *victim);

immediatly after that add:

/*
 * Special functions for working with russian(or whatever) symbols
 */

int __isalpha(int n);
int __isprint(int n);
int __isspace(int n);

2) In utils.c

go to the last line and add the following(replace '?' with proper symbols you
need to make your MUD understand them):

int __isalpha(int n)
{
 return (n=='?')||(n=='?')||(n=='?')||(n=='?')||
  (n=='?')||(n=='?')||(n=='?')||(n=='?')||isalpha(n);
}

int __isprint(int n)
{
 return isprint(n) || __isalpha(n);
}

int __isspace(int n)
{
 return (n=='\x09')||(n=='\x0A')||(n=='\x0B')||
  (n=='\x0C')||(n=='\x0D')||(n=='\x20');

}

3) in ALL source files replace isalpha with __isalpha, isprint with __isprint and
isspace with __isspace. This will make your MUD understand symbols from
upper codepage(in my case it was russian symbols, in your case it's accented
symbols, as far as I understand)

4) in comm.c

find string
      } else if (isascii(*ptr) && __isprint(*ptr)) {

replace with
      } else if (__isprint(*ptr)) {

After all these changes your MUD should understand needed symbols from
upper codepage and recognize them as printable alphabetic symbols.

There could be one more problem. If your MUD starts asking password twice
(always telling on first attempt that password is incorrect), remove all
references to echo_on and echo_off functions. This will make your MUD echo
passwords you enter, which will reduce security level, but now it's the
only solutions I've found. By the way, all russian MUDs I've seen display
password.

I think that's all.
One more problem.
If you need to support different charsets (for example, russian has
different charsets: Win-1251, KOI-8, e.t.c., you understand what I mean?),

send e-mail to LISTSERV@POST.QUEENSU.CA
with body containing string "GET CIRCLE LOG0104". This will send you
BIG file (~500Kb). Somewhere in it you'll find answer.

I hope this will help you.

Best regards,
Sergey

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/05/01 PST