@whuber: The closest I could find is
gis.stackexchange.com/questions/24554/… but unfortunately the answer is very laborious. I am looking for a tiny library that would already have borders data embedded and would tell the country without having to install anything or run any server. But I guess that does not exist?