293 {
294 SupportedEncoding result = SupportedEncoding.UTF8;
296 if (
b1 == 60 &&
b2 != 0)
297 {
298 result = SupportedEncoding.UTF8;
300 }
301 else if (
b1 ==
byte.MaxValue &&
b2 == 254)
302 {
303 result = SupportedEncoding.UTF16LE;
305 }
306 else if (
b1 == 254 &&
b2 ==
byte.MaxValue)
307 {
308 result = SupportedEncoding.UTF16BE;
310 }
311 else if (
b1 == 0 &&
b2 == 60)
312 {
313 result = SupportedEncoding.UTF16BE;
315 {
317 }
319 }
320 else if (
b1 == 60 &&
b2 == 0)
321 {
322 result = SupportedEncoding.UTF16LE;
324 {
326 }
328 }
329 else if (
b1 == 239 &&
b2 == 187)
330 {
332 {
334 }
336 }
337 else
338 {
340 }
341 return result;
342 }
static string XmlDeclMissing