Public Member Functions | |
ePlayerCharacterFilter () | |
char | Filter (unsigned char in) |
Private Member Functions | |
void | SetMap (int in1, int in2, unsigned char out) |
void | SetMap (unsigned char in, unsigned char out) |
Private Attributes | |
char | filter [256] |
Definition at line 7016 of file ePlayer.cpp.
ePlayerCharacterFilter::ePlayerCharacterFilter | ( | ) | [inline] |
map umlauts and stuff to their base characters
Definition at line 7019 of file ePlayer.cpp.
07019 { 07020 public: 07021 ePlayerCharacterFilter() 07022 { 07023 int i; 07024 filter[0]=0; 07025 07026 // map all unknown characters to underscores 07027 for (i=255; i>0; --i) 07028 { 07029 filter[i] = '_'; 07030 } 07031 07032 // leave ASCII characters as they are 07033 for (i=126; i>32; --i) 07034 { 07035 filter[i] = i; 07036 } 07037 // but convert uppercase characters to lowercase 07038 for (i='Z'; i>='A'; --i) 07039 { 07040 filter[i] = i + ('a' - 'A'); 07041 } 07042 07044 SetMap(0xc0,0xc5,'a'); 07045 SetMap(0xd1,0xd6,'o'); 07046 SetMap(0xd9,0xdD,'u'); 07047 SetMap(0xdf,'s'); 07048 SetMap(0xe0,0xe5,'a'); 07049 SetMap(0xe8,0xeb,'e'); 07050 SetMap(0xec,0xef,'i'); 07051 SetMap(0xf0,0xf6,'o'); 07052 SetMap(0xf9,0xfc,'u'); 07053 07054 // ok, some of those are a bit questionable, but still better than _... 07055 SetMap(161,'!'); 07056 SetMap(162,'c'); 07057 SetMap(163,'l'); 07058 SetMap(165,'y'); 07059 SetMap(166,'|'); 07060 SetMap(167,'s'); 07061 SetMap(168,'"'); 07062 SetMap(169,'c'); 07063 SetMap(170,'a'); 07064 SetMap(171,'"'); 07065 SetMap(172,'!'); 07066 SetMap(174,'r'); 07067 SetMap(176,'o'); 07068 SetMap(177,'+'); 07069 SetMap(178,'2'); 07070 SetMap(179,'3'); 07071 SetMap(182,'p'); 07072 SetMap(183,'.'); 07073 SetMap(185,'1'); 07074 SetMap(187,'"'); 07075 SetMap(198,'a'); 07076 SetMap(199,'c'); 07077 SetMap(208,'d'); 07078 SetMap(209,'n'); 07079 SetMap(215,'x'); 07080 SetMap(216,'o'); 07081 SetMap(221,'y'); 07082 SetMap(222,'p'); 07083 SetMap(231,'c'); 07084 SetMap(241,'n'); 07085 SetMap(247,'/'); 07086 SetMap(248,'o'); 07087 SetMap(253,'y'); 07088 SetMap(254,'p'); 07089 SetMap(255,'y'); 07090 07091 //map 0 to o because they look similar 07092 SetMap('0','o'); 07093
char ePlayerCharacterFilter::Filter | ( | unsigned char | in | ) | [inline] |
Definition at line 7095 of file ePlayer.cpp.
Referenced by ePlayerNetID::FilterName().
void ePlayerCharacterFilter::SetMap | ( | int | in1, | |
int | in2, | |||
unsigned char | out | |||
) | [inline, private] |
void ePlayerCharacterFilter::SetMap | ( | unsigned char | in, | |
unsigned char | out | |||
) | [inline, private] |
char ePlayerCharacterFilter::filter[256] [private] |
Definition at line 7114 of file ePlayer.cpp.