--- In [email protected], "silvermoonwoman2001" <sheri...@...> wrote: > > --- In [email protected], "brucexs" <bswitzer@> wrote: > > > > If you need to do some specific mathematical or string operation, > > maybe I can help on that. > > > A couple of test cases: > if utf8charstring=="\xf0\x90\x80\x80" c s/b 0x10000 > if utf8charstring=="\xf0\x90\x8a\xa9" c s/b 0x102A9 > > If I know all of the following, how do I solve for c ? > > case("tonum", utf8charstring[0]) = 0xF0 | c>>18 > case("tonum", utf8charstring[1]) = 0x80 | c>>12 & 0x3F > case("tonum", utf8charstring[2]) = 0x80 | c>>6 & 0x3F > case("tonum", utf8charstring[3]) = 0x80 | c & 0x3F > > c = ?? >
Hdf a quick look at the wikipedia article. I think want something that includes scans the bytes one at a time and does the four cases, using shifts and masks. By four cases, I am referring to whether there are 0, 1, 2, or 3 leading ones. I am not really sure I understand what are asking about above when you mention c.
