Hi Daniel,
On 2/3/20 11:45 PM, Daniel Lehman wrote: tmp = WideCharToMultiByte(locinfo->lc_codepage, WC_NO_BEST_FIT_CHARS, *wcstr, -1, NULL, 0, NULL, &used_default)-1; + if(!tmp && !count) + return 0; if(!tmp || used_default) { We're currently incorrectly checking for WideCharToMultiByte failure. tmp equals to WideCharToMultiByte()-1, so we should check if tmp==-1 instead of !tmp (or preferably store WideCharToMultiByte return value in tmp).
Thanks, Piotr