code: private static String stripBom(String str) {
          if (!str.isEmpty() && str.charAt(0) == 65279) {
              return str.substring(1);
          } else {
              return str;
          }
      }
docs: http://en.wikipedia.org/wiki/Byte_Order_Mark