Assuming you know the length of the input array, you can make the following assumptions:
- First check to see if the first few bytes correspond to Unicode Byte Icons (BOM) . If they do, everything is ready!
- "\ 0" . , UTF-16 UTF-32. '\ 0, , , UTF-32.
- -
0x80 0xff, , , ASCII UTF-7. - Unicode, UTF-8. , , . . - : ASCII, UTF-7, Base64, UTF-16 UTF-32, .