Works with extarnal entities and fix a bug processing country names with different encodings