On 2024-09-17 04:52, Eli Zaretskii wrote: > However, I'm not sure this is the right fix, the function is > defined with argument type of 'int'. Paul, any comments? Although that patch was an improvement it still had problems, as it incorrectly assumed the string does not end in a multibyte space, and that Emacs's locale matches the system's. Emacs itself should not use unless it knows the string is unibyte and the system locale matches Emacs's. I scanned through its source code looking for all problematic instances of that have crept in (except I didn't scan the MS-Windows code, where you're the expert), and found five other places where ctype.h was obviously misused. I installed the attached to fix these glitches and am boldly closing this the report. I can't easily test patch 0003, which fixes Android-specific code. Although I think it's an improvement, in unlikely cases I suspect it still doesn't exactly match what the Android kernel does with #! lines. I don't know whether that matters. I'll CC this to Po Lu (my goto person for Android) as a heads-up.