When the game renames something, any overwritten character gets replaced. Any character that isn't changed doesn't get effected.
ABCDEFG\ffff\0000\ffff
name abc->write abc\ffff to nick field
abc\ffff\EFG\ffff\0000\ffff
The new name string overwrites the old, but only for how many bytes the new name is. If the new string is shorter than the previous, there's stuff left over. Most names are capped at the final character with \ffff depending on the method of generation.
This thread is not for discussing how Pokecheck exposes hacks, only to expose flaws in how it does it.