C/C++ fgets
{
str_normalize_init();
unsigned options = SNO_TO_LOWER | SNO_TO_HALF;
if (argc > 1)
options = atoi(argv[1]);
char *buffer = (char *)malloc(65536);
memset(buffer, 0, 65536);
//相当于std::cin
while (fgets(buffer, 65536, stdin))
{
str_normalize_utf8(buffer, options);
printf("%s", buffer);
}
free(buffer);
}