What happens when you die in China?

No one plans on dying while living abroad, but sometimes bad things happen and the situation arises in which someone’s life is cut short a long way from home. In that situation, what happens? Are you buried locally or will your remains be repatriated? How is the process managed in either case? As morbid as the topic may be, and we certainly hope that this topic never need be relevant for anyone, this is something that people should be aware of when living so far from home.