findlocale is a useful library for enabling your application to guess the locale a user desires. It is designed to work on Windows and the unixes.
I am not the original author of findlocale. Adam D. Moss wrote it and I have just wrapped it in a simple buildsystem for easier installation and use by other software. I am only putting up this page as its original author seems unresponsive. If this is not the case, I'd be more than happy to fix this. His original code is available from http://icculus.org/~aspirin/findlocale/.
findlocale is currently released under pretty much the generic as-is license. If you can better classify LICENSE, please email me so I can fix this information.
I have a versioned copy of findlocale's code available at my mercurial repository here.
hg clone http://ohnopub.net/hg/findlocale
Please report bugs and feature requests at my bugzilla. If bugzilla is down, please to contact me directly.
See findlocale's source tarball for a very simple example contained in the file example.c. Findlocale's buildsystem builds this file and installs it as findlocale. If you have findlocale installed, you should be able to reproduce something similar to the following:
$ findlocale
I think that your current settings are...
Language = 'en'
Country = 'US'
Variant = 'ISO_8859-1'
$ LC_ALL="ar_EG.UTF8" findlocale
I think that your current settings are...
Language = 'ar'
Country = 'EG'
Variant = 'UTF8'