public function stripBom( $body )
    {
        if ( substr( $body, 0, 3 ) === "\xef\xbb\xbf" )  // UTF-8
        {
            $body = substr( $body, 3 );
        } else {
            if ( substr( $body, 0, 4 ) === "\xff\xfe\x00\x00" || substr( $body, 0, 4 ) === "\x00\x00\xfe\xff" )  // UTF-32
            {
                $body = substr( $body, 4 );
            } else {
                if ( substr( $body, 0, 2 ) === "\xff\xfe" || substr( $body, 0, 2 ) === "\xfe\xff" )  // UTF-16
                {
                    $body = substr( $body, 2 );
                }
            }
        }

        return $body;
    }