~sircmpwn/scdoc

scdoc/src/utf8_fputch.c -rw-r--r-- 230 bytes
badecfc6Drew DeVault Update version to 1.11.1 a month 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);
}