Quote:
Originally Posted by
jim mcnamara
well. im amazed.
i made the folowing code. event without setting a locale (aka staying with the default C locale) i can parse anything!!!
utf8/utf8io.c at master from broli's tests - GitHub
and the test file is
utf8/UTF-8-demo.html at master from broli's tests - GitHub
it cant get more utf that that. it even has braile in it
i tried to make that code fail, by setting locales to C or non UTF-8 variants, and just couldnt make it fail
for what i could gather in the webpage you gave me, alot of code is just passive (like cat, and my code)
i have to be carefull, because now, i cant asume strlen equals the amount of char AND the amount of columns when printed.
i have to use strlen to calculate the size to malloc, but to get the printable size, i need to convert it to wide characters and use wcwidth