+ case UCS2:
+ case UTF_16:
+ l = 0;
+ if (!scd->state) {
+ if (*inb < 2) goto starved;
+ c = get_16((void *)*in, 0);
+ scd->state = type==UCS2
+ ? c==0xfffe ? UCS2LE : UCS2BE
+ : c==0xfffe ? UTF_16LE : UTF_16BE;
+ if (c == 0xfffe || c == 0xfeff)
+ l = 2;
+ }
+ type = scd->state;
+ continue;
+ case UTF_32:
+ l = 0;
+ if (!scd->state) {
+ if (*inb < 4) goto starved;
+ c = get_32((void *)*in, 0);
+ scd->state = c==0xfffe0000 ? UTF_32LE : UTF_32BE;
+ if (c == 0xfffe0000 || c == 0xfeff)
+ l = 4;
+ }
+ type = scd->state;
+ continue;