Make string UTF-8 compliant.

From #5881.