As others have mentioned, this is impossible to get right -- for the simple reason that there is no consistent order -- not for the same country, the same geographic area, the same culture, or any other marker you can possibly think of.
Example: in Malaysia and Singapore, Chinese people can have traditional Chinese names -- SAA for surname and 2 characters that's their "given name" so to speak. Some have an English name -- but it's written ESAA. Some only have one character names, so it's ESA. Some surnames have 2 characters, so ESSA/ESSAA.
When filling out US forms, ESAA usually turns into Englishname Surname, and SAA turns into Givenname Surname. So the display order for the first is firstlast, but the second is lastfirst. Same country, same culture, different display order depending on whether their parents gave them English names or they chose one later in life.
When there's a middle name field, often ESAA names turns into E AA S - first middle last. This display order is wrong. It should be first last middle.
As you can see, even within the same country, same culture, same neighbourhood, you still don't have a consistent order. It's simply not possible to do this in a consistent way.