Hi all,
I am new to this form. I am developing an application where
I need to parse the below oracle line and extract the
UNISTR('\9091\0 908\090A'abc\90 9B') the unicodes(utf16 codes) out of it and convert all to utf8 multi bytes.
The problem I am facing is :
1. I have the char *string. I have prefixed \x to each of the unicode in the above line.
like
string [i] = '//';
string [i + 1 ] = 'x';
Now I have the string modified as /x9091/x0909/x090Aabc/x909B.
I am passing this string to
mbstowcs(&wchar _ptr, char_ptr, length);
then i am passing wchar_ptr to
wcstombs (output_char_pt r, wchar_ptr,lengt h);
But I am not getting the actual unicode chars or equivalent hex bytes in utf8 . I getting the same thing as above
/x9091/x0909/x090Aabc/x909B.
But if i do wchar_ptr = L"/x9091/x0909/x090Aabc/x909B". it works. constant works.
But I want to pass the dynaminc data. How to do this.?
why wcstombs is not converting the above unicodes to respective utf8 chars?
Am I doing anything wrong here. Please help me.
I am new to this form. I am developing an application where
I need to parse the below oracle line and extract the
UNISTR('\9091\0 908\090A'abc\90 9B') the unicodes(utf16 codes) out of it and convert all to utf8 multi bytes.
The problem I am facing is :
1. I have the char *string. I have prefixed \x to each of the unicode in the above line.
like
string [i] = '//';
string [i + 1 ] = 'x';
Now I have the string modified as /x9091/x0909/x090Aabc/x909B.
I am passing this string to
mbstowcs(&wchar _ptr, char_ptr, length);
then i am passing wchar_ptr to
wcstombs (output_char_pt r, wchar_ptr,lengt h);
But I am not getting the actual unicode chars or equivalent hex bytes in utf8 . I getting the same thing as above
/x9091/x0909/x090Aabc/x909B.
But if i do wchar_ptr = L"/x9091/x0909/x090Aabc/x909B". it works. constant works.
But I want to pass the dynaminc data. How to do this.?
why wcstombs is not converting the above unicodes to respective utf8 chars?
Am I doing anything wrong here. Please help me.
Comment