I know this question has been asked here several times, and I read some answers. But there are several suggested solutions, and I'm trying to figure out the best of them.
I am writing a C99 application that basically gets UTF-8 encoded XML text.
Part of his job is to copy and process this line (find substr, cat it, ex ..)
Since I would prefer not to use an external non-standard library right now, I am trying to implement it with wchar_t.
Currently im is using mbstowcs to convert it to wchar_t for easy manipulation, and for some input that I tried to use in different languages, it worked fine.
The thing is, I read some people, there were some problems with UTF-8 and mbstowcs, so I would like to hear about whether this use is allowed / acceptable.
Another option I came across is to use iconv with the WCHAR_T parameter. The fact is that I work on a platform (and not on a PC), with which its locale is very limited only for the ANSI C locale. How about this?
I also came across some C ++ library which is very popular. but it is limited to implement C99.
Also, I would compile this code on a different platform, the size of wchar_t is different (2 bytes versus 4 bytes on my machine). How can I overcome this? using containers with fixed char size? but then what manipulation functions should I use instead?
Happy to hear some thoughts. thanks.