Page MenuHomeFreeBSD

D47472.1794700364.diff
No OneTemporary

Authored By
Unknown
Size
799 B
Referenced Files
None
Subscribers
None

D47472.1794700364.diff

diff --git a/tools/tools/locale/tools/getwidths.c b/tools/tools/locale/tools/getwidths.c
--- a/tools/tools/locale/tools/getwidths.c
+++ b/tools/tools/locale/tools/getwidths.c
@@ -28,6 +28,21 @@
#include <utf8proc.h>
+static int
+width_of(int32_t wc)
+{
+
+ /*
+ * Hangul Jamo medial vowels and final consonants are more of
+ * a combining character, and should be considered zero-width.
+ */
+ if (wc >= 0x1160 && wc <= 0x11ff)
+ return (0);
+
+ /* No override by default, trust utf8proc's width. */
+ return (utf8proc_charwidth(wc));
+}
+
int
main(void)
{
@@ -43,9 +58,10 @@
wcc = utf8proc_category(wc);
if (wcc == UTF8PROC_CATEGORY_CC)
continue;
- wcw = utf8proc_charwidth(wc);
+ wcw = width_of(wc);
if (wcw == 1)
continue;
+
printf("%04X %d\n", wc, wcw);
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 14, 11:52 PM (15 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41734278
Default Alt Text
D47472.1794700364.diff (799 B)

Event Timeline