Bruno Haible wrote: > You can assume that mbrtowc returns > 0 if and only if the multibyte sequence is a NUL byte - but you had > chosen srcend in such a way that this would not happen in the loop. Thanks for the correction. I mistakenly thought that C allows multibyte encodings in which a null wide character's multibyte representation contains an all-bits-zero byte. I installed the attached to omit the unnecessary test.