On 03/14/2011 10:06 AM, Chet Ramey wrote: >> On 03/14/2011 07:55 AM, Chet Ramey wrote: >>> The question is how to best handle it: punt immediately, or just treat it >>> as a single-byte character and move on. >> >> I vote single-byte character; after all, it's possible for a filename to >> contain that character, regardless of what your locale may be. > > Oh, it does do that. I meant in the context of attempting to convert the > entire string to a wide-char string. If the wide-char string conversion > fails, the globbing engine treats it as a sequence of single bytes. There > are efficiency improvements that can be made there, though.
Yeah. But if we treat it as a single char and move on, we can at least "correctly" treat any further, legal character sequences. Not that anyone should have any particular expectations once they include an invalid character, if the further characters aren't in the same encoding as the actual filename... -- Micah J. Cowan http://micah.cowan.name/