~sircmpwn/scdoc

ref: 9f74b6a0bf9794081b755274bbddd15deb6a10aa scdoc/src/utf8_fputch.c -rw-r--r-- 230 bytes
9f74b6a0Drew DeVault Parse section headings 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
#include <stdint.h>
#include <stdio.h>
#include "unicode.h"

size_t utf8_fputch(FILE *f, uint32_t ch) {
	char buffer[UTF8_MAX_SIZE];
	char *ptr = buffer;
	size_t size = utf8_encode(ptr, ch);
	return fwrite(&buffer, 1, size, f);
}