why is nguyen spelled that way?
This is Vietnamese pronunciation of the former common Chinese surname 阮 which later came to be written as Nguyễn in Vietnamese. Due to inefficiencies of Latin script, they ended up making approximate sound symbols and addind diacritics to represent the tones.