aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/utf8/u8wdth.c
blob: 0bc57859fe0f4007556c6cedb920f28341ea2c54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "utf8.h"

#include "internal/common.h"

int
u8wdth(rune ch)
{
	return ch <= _1B_MAX ? 1
	     : ch <= _2B_MAX ? 2
	     : ch <= _3B_MAX ? 3
	     : ch <= _4B_MAX ? 4
	                     : 0;
}