页面能显示中文 不是编码问题 
为什么加密后就成乱码?要怎么处理

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
header("Content-Type:text/html; charset=utf-8");$str="床前明月光,疑是地上霜"; //被加密的内容
$key="key:111"; //密匙
$cipher=MCRYPT_DES;  //加密算法类型
$mode=MCRYPT_MODE_ECB;  //加密算法模式
$iv=mcrypt_create_iv(mcrypt_get_iv_size($cipher, $mode),MCRYPT_RAND); //初始化向量
echo "加密前".$str."<br>";
//加密
$str_encrypt=mcrypt_encrypt($cipher,$key,$str,$mode,$iv);
echo "加密后".$str_encrypt."<br>";
//还原
$str_decrypt=mcrypt_encrypt($cipher,$key,$str_encrypt,$mode,$iv);
echo "还原".$str_decrypt."<br>";?>