Handling UTF-8 variables (taken from dev_3.03 branch).