Re: [PATCH] Use FIX_UTF8_MAC to enable conversion from UTF8-MAC to UTF8

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Jan 2008, Linus Torvalds wrote:

> First off, the common case is that the filename likely has everything in 
> plain 7-bit ascii. So rather than re-encoding by default, the first thing 
> to do is to just see if it even needs re-encoding. Even if it's as simple 
> as saying "does it have any high bits at all", that's going to be a *huge* 
> performance win.
> 
> So start off with something like
> 
> 	int is_usascii(const char *p)
> 	{
> 		char c;
> 
> 		do {
> 			c = *p++;
> 		} while (c > 0);
> 		return !c;
> 	}

You need to use "signed char" here.  On ARM a char is unsigned by 
default.  That's the case on some other systems too.


Nicolas
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux