[d]怎么转成utf-8
本帖最后由 fibbery 于 2012-07-30 10:43:14 编辑 下面这编码怎么转成utf-8 ,用C#代码,最好写个例子,谢谢!
$xmldata=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%3C%21DOCTYPE+InterBOSS%3E%0A%3CInterBOSS%3E%0A++%3COrigDomain%3EBBSS%3C%2FOrigDomain%3E%0A++%3C%21--%E5%8F%91%E8%B5%B7%E6%96%B9%E5%BA%94%E7%94%A8%E5%9F%9F%E4%BB%A3%E7%A0%81--%3E%0A++%3CHomeDomain%3ELBMP%3C%2FHomeDomain%3E%0A++%3C%21--%E5%BD%92%E5%B1%9E%E6%96%B9%E5%BA%94%E7%94%A8%E5%9F%9F%E4%BB%A3%E7%A0%81--%3E%0A++%3CBIPCode%3EBIP4B766%3C%2FBIPCode%3E%0A++%3C%21--%E4%B8%9A%E5%8A%A1%E5%8A%9F%E8%83%BD%E4%BB%A3%E7%A0%81--%3E%0A++%3CBIPVer%3E0100%3C%2FBIPVer%3E%0A++%3C%21--%E4%B8%9A%E5%8A%A1%E6%B5%81%E7%A8%8B%E7%89%88%E6%9C%AC%E5%8F%B7--%3E%0A++%3CActivityCode%3ET4011024%3C%2FActivityCode%3E%0A++%3C%21--%E4%BA%A4%E6%98%93%E4%BB%A3%E7%A0%81--%3E%0A++%3CActionCode%3E0%3C%2FActionCode%3E%0A++%3C%21--%E4%BA%A4%E6%98%93%E5%8A%A8%E4%BD%9C%E4%BB%A3%E7%A0%81--%3E%0A++%3CRouting%3E%0A++++%3C%21--%E8%B7%AF%E7%94%B1%E4%BF%A1%E6%81%AF--%3E%0A++++%3CRouteType%3E00%3C%2FRouteType%3E%0A++++%3C%21--%E8%B7%AF%E7%94%B1%E7%B1%BB%E5%9E%8B--%3E%0A++++%3CRouteValue%3E000%3C%2FRouteValue%3E%0A++++%3C%21--%E8%B7%AF%E7%94%B1%E5%85%B3%E9%94%AE%E5%80%BC--%3E%0A++%3C%2FRouting%3E%0A++%3CProcID%3E001600005555SUF633020190tb0036%3C%2FProcID%3E%0A++%3C%21--%E4%B8%9A%E5%8A%A1%E6%B5%81%E6%B0%B4%E5%8F%B7--%3E%0A++%3CTransIDO%3E001600005555SUF633020190tb0036%3C%2FTransIDO%3E%0A++%3C%21--%E5%8F%91%E8%B5%B7%E6%96%B9%E4%BA%A4%E6%98%93%E6%B5%81%E6%B0%B4%E5%8F%B7--%3E%0A++%3CTransIDH%2F%3E%0A++%3C%21--%E5%BD%92%E5%B1%9E%E6%96%B9%E4%BA%A4%E6%98%93%E6%B5%81%E6%B0%B4%E5%8F%B7--%3E%0A++%3CProcessTime%3E20120716100500%3C%2FProcessTime%3E%0A++%3C%21--%E5%A4%84%E7%90%86%E6%97%B6%E9%97%B4--%3E%0A++%3CSPReserve%3E%0A++++%3C%21--%E4%B8%80%E7%BA%A7BOSS%E4%BF%9D%E7%95%99%E4%BF%A1%E6%81%AF--%3E%0A++++%3CTransIDC%3E0000BBSSSUF6330%3C%2FTransIDC%3E%0A++++%3C%21--%E4%B8%80%E7%BA%A7BOSS%E4%BA%A4%E6%98%93%E6%B5%81%E6%B0%B4%E5%8F%B7--%3E%0A++++%3CCutOffDay%3E20120717%3C%2FCutOffDay%3E%0A++++%3C%21--%E6%97%A5%E5%88%87%E7%82%B9--%3E%0A++++%3COSNDUNS%3E0000%3C%2FOSNDUNS%3E%0A++++%3C%21--%E5%8F%91%E8%B5%B7%E6%96%B9%E4%BA%A4%E6%8D%A2%E8%8A%82%E7%82%B9%E4%BB%A3%E7%A0%81--%3E%0A++++%3CHSNDUNS%3E0000%3C%2FHSNDUNS%3E%0A++++%3C%21--%E5%BD%92%E5%B1%9E%E6%96%B9%E4%BA%A4%E6%8D%A2%E8%8A%82%E7%82%B9%E4%BB%A3%E7%A0%81--%3E%0A++++%3CConvID%3E001800005555SUF633020090424144620749%3C%2FConvID%3E%0A++++%3C%21--%E4%BA%A4%E6%8D%A2%E4%B8%AD%E5%BF%83%E5%A4%84%E7%90%86%E6%A0%87%E8%AF%86--%3E%0A++%3C%2FSPReserve%3E%0A++%3CTestFlag%3E1%3C%2FTestFlag%3E%0A++%3C%21--%E6%B5%8B%E8%AF%95%E6%A0%87%E8%AE%B0--%3E%0A++%3CMsgSender%3E0000%3C%2FMsgSender%3E%0A++%3C%21--%E6%B6%88%E6%81%AF%E5%8F%91%E9%80%81%E6%96%B9%E4%BB%A3%E7%A0%81--%3E%0A++%3CMsgReceiver%3E0050%3C%2FMsgReceiver%3E%0A++%3C%21--%E6%B6%88%E6%81%AF%E7%9B%B4%E6%8E%A5%E6%8E%A5%E6%94%B6%E6%96%B9%E4%BB%A3%E7%A0%81--%3E%0A++%3CSvcContVer%3E0100%3C%2FSvcContVer%3E%0A++%3C%21--%E4%B8%9A%E5%8A%A1%E5%86%85%E5%AE%B9%E6%8A%A5%E6%96%87%E7%9A%84%E7%89%88%E6%9C%AC%E5%8F%B7--%3E%0A++%3CSvcCont%3E%3C%21%5BCDATA%5B%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3C%21DOCTYPE+ECInfo%3E%0A%3CECInfo%3E%0A++%3C%21--EC%E4%BF%A1%E6%81%AF--%3E%0A++%3COprCode%3E01%3C%2FOprCode%3E%0A++%3C%21--%E6%9C%ACEC%E4%BF%A1%E6%81%AF%E7%9A%84%E6%93%8D%E4%BD%9C%E7%BC%96%E7%A0%81--%3E%0A++%3CECID%3E11111222223333344444shgjxx0001%3C%2FECID%3E%0A++%3C%21--%E4%B8%80%E7%BA%A7EC%E7%BC%96%E7%A0%81--%3E%0A++%3CProvECID%3E11111222223333344444shgjxx0001%3C%2FProvECID%3E%0A++%3C%21--%E4%B8%BB%E5%8A%9E%E7%9C%81EC%E7%BC%96%E7%A0%81--%3E%0A++%3CECName%3E%E4%B8%8A%E6%B5%B7%E5%85%AC%E4%BA%A4%E4%BF%A1%E6%81%AF%E9%87%87%E9%9B%86%E5%AE%A2%E6%88%B7%3C%2FECName%3E%0A++%3C%21--EC%E4%B8%AD%E6%96%87%E5%90%8D%E7%A7%B0--%3E%0A++%3CECEName%3E11111222223333344444cqsfjz0000%3C%2FECEName%3E%0A++%3C%21--EC%E8%8B%B1%E6%96%87%E5%90%8D%E7%A7%B0--%3E%0A++%3COprTime%3E20120717100500%3C%2FOprTime%3E%0A++%3C%21--%E6%93%8D%E4%BD%9C%E6%97%B6%E9%97%B4--%3E%0A++%3CEffTime%3E20120717%3C%2FEffTime%3E%0A++%3C%21--%E7%94%9F%E6%95%88%E6%97%B6%E9%97%B4--%3E%0A++%3CECTel%3E13800000000%3C%2FECTel%3E%0A++%3C%21--EC%E8%81%94%E7%B3%BB%E7%94%B5%E8%AF%9D--%3E%0A++%3CContractTel%3E13888888888%3C%2FContractTel%3E%0A++%3C%21--%E5%AE%A2%E6%88%B7%E7%BB%8F%E7%90%86%E8%81%94%E7%B3%BB%E7%94%B5%E8%AF%9D--%3E%0A++%3CContractName%3Esong%3C%2FContractName%3E%0A++%3C%21--%E5%AE%A2%E6%88%B7%E7%BB%8F%E7%90%86%E5%A7%93%E5%90%8D--%3E%0A%3C%2FECInfo%3E%5D%5D%3E%3C%2FSvcCont%3E%0A%3C%2FInterBOSS%3E
----------------------
Double行动:
原帖分数:40
帖子加分:40
[解决办法]
use URI::Escape;
print uri_unescape $xmldata;
str.decode("GB2312").encode("utf-8")