src/vs/base/common/strings.ts/charCount
export function charCount(str: string): number {
	const iterator = new GraphemeIterator(str);
	let length = 0;
	while (!iterator.eol()) {
		length++;
		iterator.nextGraphemeLength();
	}
	return length;
}