X-ray phase determination by the principle of minimum charge