Fix enum-to-unicode conversion code in C++ mode where direct assignments from C int to enum are not allowed.