git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

From
Peter Krefting <peter@softwolves.pp.se>
Date
Jul 1, 2013, 07:12 UTC
Message-ID
<alpine.DEB.2.00.1307010811090.21709@ds9.cixit.se>
In-Reply-To
<20130629174023.GB226907@vauxhall.crustytoothpaste.net>
brian m. carlson:
> +		/* Check the value here */
> +		if (codepoint >= 0xd800 && codepoint <= 0xdfff)
> +			return bad_offset;
if ((x & 0xFFFFF800) == 0xD800)
is slightly shorter, albeit a bit more difficult to read.

Please also consider adding some commentary as to what you are checking here, as it is not obvious unless you know Unicode well.

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Junio C Hamano
Message 7 of 7 in “commit: reject invalid UTF-8 codepoints”
  1. 1/2 commit: reject invalid UTF-8 codepointsbrian m. carlson, Jun 29, 2013
  2. Junio C HamanoJun 30, 2013
  3. brian m. carlsonJun 30, 2013
  4. Junio C HamanoJun 30, 2013
  5. brian m. carlsonJul 4, 2013
  6. Junio C HamanoJul 4, 2013
  7. Peter KreftingJul 1, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.