The anonymous function reads tokens using token.get_next(), processes them, and then supplies them (or different ones) to TeX by its return value. The function unicode.utf8.char reads a numeric value and produces a UTF-8 character. For all functions in the string library of lua you have the equivalents functions in the unicode.utf8 library which is loaded by luatex.