Author Topic: Support Chinese Traditional Nickname  (Read 2340 times)

Offline Eternity

  • First timer
  • *
  • Posts: 5
    • View Profile
Support Chinese Traditional Nickname
« on: November 26, 2001, 05:57:00 pm »
a request to include a function that allow user to use traditional chinese nick (ZH_TW), the following code has been added/edited to my Ultimate 3.0.0.a17 (m_nick.c) and works fine:

int isZh_TWBig5(unsigned char CHighByte, unsigned char CLowByte)
{  if (( CHighByte < 0xFA ) && ( CHighByte > 0xA0 ))
        {       if (( CLowByte > 0x3F ) && ( CLowByte < 0x7F ))
                        return 1;
                if (( CLowByte > 0xA0 ) && ( CLowByte < 0xFF ))
                        return 1;
        }
        return 0;
}
static int do_nick_name(char *nick)
{
  unsigned char *ch, *pnick = nick;
  unsigned char lastChar;
   
 /*
 modified by wHisKy
  if (*nick == '-' || isdigit(*nick) || )
      return 0;
 */

  if (*pnick == '#' || *pnick == '@' || *pnick == '!' || *pnick == '-' || *pnick == '%' || *pni
    return 0;
 
  for ( ch = pnick ; *ch && (ch - pnick) < NICKLEN; ch++)  
  {  if ( ( *ch & 0x80 ) &&  ( !isspace ( * ( ch + 1) ) ) )
     {  lastChar = * ( ch++);
         if ( !isZh_TWBig5(lastChar,*ch))
                 {      ch--;
            break;
                 }
     }
     else if (!isvalid(*ch) || isspace(*ch))
         break;
  }  
 
  *ch = '';
 
  return (ch - pnick);
}

I found that this code works without any error when do_nick_name function in file m_nick.c (i dont know much about programming), and with some errors when s_user.c : Unreal IRCD and maybe Ultimate 2.8 ...... anyway... hope the support of chinese nick can add into the new release..

thx alot :smile:

[ This Message was edited by: Eternity on 2001-11-26 09:06 ]

Offline ShadowMaster

  • Chief Codemonkey
  • Administrator
  • ********
  • Posts: 3136
    • View Profile
    • http://www.shadow-realm.org/
Support Chinese Traditional Nickname
« Reply #1 on: November 27, 2001, 06:51:00 am »
This will be considered both for 2.8 and the current 2.9 development tree.

Please contact me by email:
ShadowMaster at Shadow-Realm dot org

So i can arrange for final testing and also proper credits.
Search before posting - No support by PM or IM

 

anything