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

[PATCH v3 2/3] update-unicode.sh: strip the plane offsets from the double_width[] table

From
Beat Bolli <dev+git@drbeat.li>
Date
Dec 3, 2016, 13:19 UTC
Message-ID
<1480771173-731-2-git-send-email-dev+git@drbeat.li>
In-Reply-To
<1480771173-731-1-git-send-email-dev+git@drbeat.li>

The function bisearch() in utf8.c does a pure binary search in double_width. It does not care about the 17 plane offsets which unicode/uniset/uniset prepends. Leaving the plane offsets in the table may cause wrong results.

Filter out the plane offsets in update-unicode.sh.
Cc: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
 update_unicode.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/update_unicode.sh b/update_unicode.sh
index 3c84270..4c1ec8d 100755
--- a/update_unicode.sh
+++ b/update_unicode.sh
@@ -30,7 +30,7 @@ fi &&
 		  grep -v plane)
 	};
 	static const struct interval double_width[] = {
-		$(uniset/uniset --32 eaw:F,W)
+		$(uniset/uniset --32 eaw:F,W | grep -v plane)
 	};
 	EOF
 )
-- 
2.7.2
Previous: Beat BolliNext: Beat Bolli
Message 7 of 18 in “update-unicode.sh: automatically download newer definition files”
  1. 1/2 update-unicode.sh: automatically download newer definition filesBeat Bolli, Dec 2, 2016
  2. 2/2 unicode: update the tables to Unicode 9.0Beat Bolli, Dec 2, 2016
  3. 3/3 unicode_width.h: fix the double_width[] tableBeat Bolli, Dec 3, 2016
  4. 1/3 update-unicode.sh: automatically download newer definition filesBeat Bolli, Dec 3, 2016
  5. 3/3 unicode_width.h: fix the double_width[] tableBeat Bolli, Dec 3, 2016
  6. 1/3 update-unicode.sh: automatically download newer definition filesBeat Bolli, Dec 3, 2016
  7. 2/3 update-unicode.sh: strip the plane offsets from the double_width[] tableBeat Bolli, Dec 3, 2016
  8. 3/3 unicode_width.h: update the tables to Unicode 9.0Beat Bolli, Dec 3, 2016
  9. Torsten B��gershausenDec 3, 2016
  10. Beat BolliDec 3, 2016
  11. 1/3 update-unicode.sh: automatically download newer definition filesBeat Bolli, Dec 3, 2016
  12. 2/3 update-unicode.sh: strip the plane offsets from the double_width[] tableBeat Bolli, Dec 3, 2016
  13. 3/3 unicode_width.h: update the tables to Unicode 9.0Beat Bolli, Dec 3, 2016
  14. Torsten BögershausenDec 4, 2016
  15. Junio C HamanoDec 5, 2016
  16. Beat BolliDec 7, 2016
  17. jbh, Dec 7, 2016
  18. 2/3 unicode_width.h: update the tables to Unicode 9.0Beat Bolli, Dec 3, 2016

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.