Unicode programing in C

im starting to go a little serious with c, woking in a personal project that will read a xml, which might contain Unicode characters (i know it will on my system, which is set to es_AR.UTF-8)

im using mxml, and the documentation says it uses utf8 internally (no worries here).
so i need to be sure im using utf8 in my program. to be sure that i can safely interact with mxml and to be sure my program will work in all languages.

i have been reading alot, but i dont quite fully get how i can accomplish this.

im going for something simple, something easy that wont demand much of me.

my program will read user input (from cli for now, gtk later), and will save it in xml (is a config file for other app). it will also have the option to read a xml, and use it as a base for a new one

now, i have a few concrete questions.
a) do i have to use a special type of variable?
if a) is true, then i need a hole new set of functions? (for strcmp, or strstr)
b) can i work with unicode characters using char *?
if b) is true, how do i "make" them utf8?
c) is a mix of the above? then how to choose the mix ratio?

i appreciate any help, manual, link, ect that can help me understand how this works. (that includes source code)

thanks

A lot of code is passive, IMO. But there are still some issues:

Linux Unicode programming

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

Don't forget I/O functions. Use the %c format string in the *wprintf() family when you need to print a single wide char, for example. There are a few gotchas, but not many.

at this point, im deciding for setting the locale to mach the user's choice, and then code like always, and wait for a user to hit a problem and make a bugreport :stuck_out_tongue:

dont think im gona have much trouble

thanks fro the help