changed upcase to downcase, added unicode-aware conversion
added language detection from environment for case conversion.