One must keep in mind however that gwei (鬼) in gweilo (鬼佬) may be used to express hate and deprecation. A case in point is when many Chinese families watched as their mothers were killed and daughters taken into forced prostitution by the Japanese during World War II. At that time the term they chose to express their greatest hatred towards the Japanese was (鬼), the same gwei that is used for gweilo.
The pejorative sense is further intensified when the term is prefaced by the Chinese word sei (死, jyutping: sei2, meaning: death, damnation); sei gweilo (死鬼佬), literally means "dead ghost man", using the translation "dead" for "sei" (死) because it is only correct to be used as an adjective. However, the word "sei gweilo", when used to describe a living person, means "bad person". "Sei" (死) is commonly added to other terms in order to describe the person or people being referred to as "bad", such as "sei lo" (死佬), meaning literally "dead man" or "bad guy" and "sei chai lo" (死差佬), literally "dead policeman" or "bad policeman". Chinese people also can call each other "Sei gwei" (死鬼) in some situations, literally meaning "dead ghost", but refers to a bad man also. Even without the word sei (死) the character (鬼) itself can express intense loathing as when it was attached to the Japanese military in the term "Guizi Bing" (鬼子兵) during their massacre of what some have estimated to be upwards to 30 million Chinese during World War II.
While "gwailo" is commonly used by some Cantonese speakers in informal speech, the more polite alternative sai yan (西人; jyutping: sai1 jan4, literally: "western person") is now used.
The term is often considered racist by non-Cantonese people. Many Cantonese speakers, however, frequently use the term to refer to white people and westerners in general and they consider the term non-derogatory, a controversial notion.. The term was commonly prefaced by sei (死; jyutping: sei2, meaning: death, damned) as in sei gweilo, meaning "damned ghost man", and used pejoratively with sei as the pejorative suffix.
Use of the term "gwei" to refer to Westerners is frequently referenced in Maxine Hong Kingston's The Woman Warrior.
Due to its widespread use, the term gwei, which means ghost, has taken on the general meaning of "foreigner" and can refer to the European races since Indians, Filipinos, Indonesians, African and other races have their own separate racial terms that are used for them instead of gweilo. The following variant of the term is considered racist because they are specific to a group of people based on their racial characteristic:
... While historically, "gwai lo" may have been used by Chinese people as a racist remark concerning foreigners, particularly European Westerners, the persons consulted by the Council indicate that it has since lost much of its racist overtone. The Council finds that the expression has also lost most of its religious meaning, so that "foreign devil" no longer carries the theological significance it once did. Based on its research, the Council understands that the expression has gone from being considered offensive to, at worst, merely "impolite".According to CFMT-TV, "Gwei Lo" was used as "a self-deprecating term of endearment". Others, however, particularly foreigners living in Hong Kong, find the term demeaning and/or racist. However, it is also used by some non-Chinese (sometimes jocularly) to address themselves.
In Mandarin, guizi is a similar term to gweilo. Guizi, however, can be used to refer to either the Japanese (specifically, 日本鬼子 rìběn guǐzi "Japanese ghost" or 东洋鬼子 dōngyáng guǐzi "east ocean ghost") or Europeans (洋鬼子 yáng guǐzi "foreign ghost"). Laowai (老外 lǎowài "old foreigner" or "old outsider") is a word usually used for Europeans, and is a less pejorative term in Mandarin than guizi. Also, cf. Ang Mo (POJ: âng-mo) meaning 'red hair' (Hokkien) .