I don’t know why there is so much debate over this. To handle the occasions where we may run into other foreigners, we should treat them like our comrades rather than germs we can’t wait to wash our hands of.
So in honour of that sentiment, I propose a foreigner code of conduct for just this situation.
If you meet another foreigner on the street, you can choose to make eye contact, nod in acknowledgment or smile. If they dont’ acknowledge you, don’t take offence. However if someone does do any of these things in your direction and you are aware of it, acknowledge it somehow. It does not mean you have to have a conversation.