Returns a newly-allocated copy of str
, with invalid characters replaced by Unicode replacement characters (U+FFFD).
For null
str
returns newly allocated empty string ("").
str |
a UTF-8 string |
a newly-allocated string |