Re: Accentuation

From: Mike Breuer (mbreuer@new.rr.com)
Date: 04/11/01


>   I'm the implementor of a mud in Brazil and my great difficulty at this
>   moment  is  the  implementation of accentuation on my mud... I like to
>   know if some of you experienced the same and if there's a solution...

I have limited experience with this, but my first thought would be that you
would need to give players the ability to select between character sets for
output.  A simple function could "translate" the accentuated characters to
7-bit ASCII for those who do not have the appropriate character set
available on their client:

/* Example translation table */
const char translation_table[256] =
{ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 31 */
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 63 */
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 95 */
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 127 */
  0, 129 ^ 'u', 130 ^ 'e', 131 ^ 'a',
  (...etc...)
};

void translate( char *str ) {
  if (!str) return;

  while (*str) {
    *str ^= translation_table[*str];
    str++;
  }
}

Players could toggle between translated and untranslated output, depending
on whether they could use your chosen character set.  You could get really
ambitious and support multiple character sets and multiple translations...

Mike

--
   +---------------------------------------------------------------+
   | 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