Handle unicode in the config file.

Fix #2481.