aboutsummaryrefslogtreecommitdiff
path: root/gen/prop/wdth.c
blob: a9379cf3057c35d54f19cdb42cf6ddb84b53d8d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#if 0
cd "${0%/*}/../.."
trap 'rm -f /tmp/wdth' EXIT
cc -Iinclude -std=c23 -Wno-attributes -fsanitize=address,undefined \
	-lunistring -o /tmp/wdth gen/prop/wdth.c libmlib.a
/tmp/wdth
exit 0
#endif

/* Cheating slightly because I am lazy; using libunistring to figure out the
   values here */

#include <stdio.h>
#include <stdlib.h>

#include <rune.h>
#include <uniwidth.h>

int
main(void)
{
	for (ucs4_t ch = 0; ch <= RUNE_MAX; ch++)
		printf("%04" PRIXRUNE " %d\n", ch, uc_width(ch, "UTF-8"));
	return EXIT_SUCCESS;
}