A
Andrew V. Tkachenko
Hello.
I'm newbie in C programming, so I'm sorry for (probably stupid)
question, but I'm stuck with it.
I use 'iconv' function to convert from utf8 to ucs4
iconv(iconv_t cd, char *in, char *out ....)
so, I got 'out' as a result of operation. But I need result as array of
uint32_t type, not chars. How can I do such conversion?
Is it legal to 'pack' array of chars into uint32 array using the method
below?
uint32_t inta[50];
char string[] = "123456789";
char *p = (char *)inta;
char *p1 = (char *)string;
for(;*p1;p1++, p++)
{
*p = *p1 & 0xFF;
}
Thanks for advance.
I'm newbie in C programming, so I'm sorry for (probably stupid)
question, but I'm stuck with it.
I use 'iconv' function to convert from utf8 to ucs4
iconv(iconv_t cd, char *in, char *out ....)
so, I got 'out' as a result of operation. But I need result as array of
uint32_t type, not chars. How can I do such conversion?
Is it legal to 'pack' array of chars into uint32 array using the method
below?
uint32_t inta[50];
char string[] = "123456789";
char *p = (char *)inta;
char *p1 = (char *)string;
for(;*p1;p1++, p++)
{
*p = *p1 & 0xFF;
}
Thanks for advance.