Graphic pejoratives in written Chinese

Some Chinese characters for non-Chinese people were racist insults where the words themselves were not the insults, but the characters chosen to write them were. These characters chosen to racially insult people are called graphic pejoratives. 
History.
An example of this is the name of the Yao people. The name of the Yao people, who are native to southwest China and Vietnam, used to be written as 猺 ("Yáo"), which means "jackal". However, when China made language reforms in the 20th century, the name of the Yao people was changed to 瑶, which has the exact same pronunciation, but the character means "jade". 
Another example is Japan's original name. Before Japan chose its own name, the Chinese called the Japanese 倭 ("Wō"), which is pronounced "Wa" in Japanese and it means "dwarf; subservience". However, the Japanese thought the name the Chinese gave them was insulting, so the Japanese changed the Chinese exonym to 和, which has the same pronunciation as 倭 in Japanese but means "harmony", and the Japanese chose to call their own country 日本, which is pronounced "Nippon" or "Nihon" in Japanese and it means "origin of the sun".