How can I get the value of LANG from locale programatically in Redhat Linux ... Is there some function like getlocale(), like we have setlocale() I need to generate XML file in UTF-8 or SHIFT_JIS depending on the system locale. Rgds, Gaurav.