有一段文本,从mysql读取的,用 SyntaxHighlighter 显示$content = $vFile->Content;
echo mb_convert_encoding($content, "utf-8", "gb2312");第一行老显示12个空白字符,其他行正确。
是 mb_convert_encoding引起的吗? 但又不像。MySQLSyntaxHighlighter

解决方案 »

  1.   

    echo base64_encode($content);
    贴出结果多半是 BOM 头
      

  2.   

    我开始也想BOM头,但12个字符又好像不对……
    如果有字节数据或者可以判断
      

  3.   

    代码              <?php echo base64_encode($vFile->Content); ?>
                <?php
                $content = $vFile->Content;
                $mystr = mb_convert_encoding($content, "utf-8", "gb2312");
                echo $mystr;
                ?>