The script examples/functions/lowercase, originally written by John DuBois, will do the trick. The converse is left as an exercise.