On Fri 26 Nov 2004, Stefan Nehlsen wrote: > On Tue, Nov 23, 2004 at 05:29:57PM +0100, Paul Slootman wrote: > > + /* Replace non-printing chars in the string, most probably due > > to > > + * wierd filenames. Skip the first and last chars, they may be > > \n */ > > + int i; > > + for (i=1; i<len-1; i++) > > + if (!isprint(buf[i])) > > + buf[i] = '?'; > > Is looping over strings a good idea in times of UTF-8?
It is if you don't know the strings are in UTF-8, and you want to prevent "garbage" chars reaching the tty (the whole point of this exercise :-) Paul Slootman -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html