Encode JavaScript strings in UTF8