The function has an argument which represents the destination buffer size. Thus it outputs only a valid multibyte sequence if the buffer does not have enough size.
[Back: ]
[Next: ]