bench-my-utf8/icu/icu-read-utf8.c

12 lines
366 B
C

#include <unicode/ustdio.h>
#include <stdlib.h>
#include <unicode/umachine.h>
int main(void)
{
UFILE *in = u_fopen("text-test-data/english.txt", "r", NULL, "UTF-8");
// Using a 10 MB buffer for now. It fits all the corpus I want to test agaisnt.
UChar *charBuff = malloc(10000000 * sizeof(UChar));
int32_t i = u_file_read(charBuff, 10000000, in);
}