我想把下面内容转成网页格式,charset=utf-8 ,懂的人进来帮忙解决内容:如下
<div class="__aliyun_email_body_block"><DIV><BR>&nbsp;</DIc嘈E頧墡?#迈嘈E鈌?7瞗?7??螜?y∟h?K何[嫀妜.yㄤ骇鍝佸箍鍛婁竴鐐归兘娌℃湁锛屽姞涓婂幓锛?BR>&nbsp;&nbsp;f?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗?7瞗bsp;&nbsp; 闄?BR><BR>鍏徃鍦板潃锛氭禉姹熷畞娉㈠寲瀛﹀伐K壆X水XzN泭>媧髎#瀀鹯h?i漱iJ?x:辿?SsN觾cS#?抧bsp;閭紪锛?15204 www.929.com.cn <BR><BR></P>
<P>-----乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙--<BR>鍙戜欢浜猴細[email protected]<BR>鍙戦€佹棩鏈燂細2012[汣>i葍^izR?s?#頸KnK籲K?哣鈌荂?哣??杤荲R??gt;;<BR>涓婚锛氫箟涔屽簵闈績閿€浜у搧璁捐<BR></P>
腄昩6?73挣?茥梀鬻&Wf桏W5?V鱂S嘈DD昩6?73挣?茥梀弼Vail_body_block>
<DIV>闄堟€伙細</DIV>
<DIV>浣犲ソ锛?/DIV嘈DD昪鈌?7陈鬌昪嘈DD昪顧楴K籲i婠K槥K樜[﹡欄.K?橦y∟Kу搧GT-12绾稿崱璁捐锛岃鏌ユ敹銆?BR></DIV><BR><BR><BR>校腄昪隳d翦Bf6S?&??6銎??6棪S??W7B&Vv&G2鬽ily</FONT></DIV>
<DIV><FONT face=Arial color=#000000><ST$翡s庖乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙乙勇?RONG></FONT></DIV>
<DIV><FONT face=Arial color=#ff9900><SE$翡s澶凴鋜TU$R4凾詳4?4蜮呐DC迈5E$翡s懵鬱翦C?DIV>
<DIV><STRONG><FONT face=Arial color=#38761d size=2>DC#?fV鎣謻鎟&?B?鏂鎣&?6哣謻6?栨GW7G'?鍿卖d翦C</STRONG></DIV>
<DIV><STRONG><FONT face=Arial color=#3876B6棪S?錐V茫僢覵sB觾cS#?抐?7瞗?7瞗?7?f?7磃?6-574-8650 5939</FONT></STRONG></DIV>
<DIV><STRONG><FONTf6S?&??6銎??3僺cB6棪S?銿?柮謻菙?杤荲R?鲆f鎠p;&nbsp; </FONT></STRONG></DIV>
<DIV><STRONG><FONT face=&??6銎??3僺cB6棪S?湔4悝V謻菗??茥fR?懵鬱翦C懵?EONG></DIV>
<DIV><STRONG><FONT face=Arial color=#38761d si??#SBS儍Bf?7?嘱&柶Sb?3?儞##sS卖d翦C懵?RONG></DIV><BR><BR></DIV></DIV></div>

解决方案 »

  1.   

    MemoryStream 到 stringstream,再到string,再UTF8Decode
      

  2.   

    1.UTF8Decode 返回空值2.用下面方法也不对   ,谁来帮帮忙function DecodeUtf8Str(const S:UTF8String): WideString;
    var lenSrc,lenDst ,i : Integer; 
    begin
     lenSrc  := Length(S);
      if(lenSrc=0)then Exit;
      lenDst  := MultiByteToWideChar(CP_UTF8, 0, Pointer(S),lenSrc, nil, 0);
       SetLength(Result, lenDst);
      MultiByteToWideChar(CP_UTF8, 0, Pointer(S),lenSrc, Pointer(Result), lenDst);end;
      

  3.   

    代码放上来,还有你的delphi 版本
      

  4.   

    htmls:TStringshtmls.Text内容在一楼
    htmls.Text := DecodeUtf8Str(htmls.Text)
    这些够了吗
      

  5.   

    完整点的,读取网站的 html 的代码 
      

  6.   

    PartStream :TMemoryStream;PartStream:通过第三方工具读取的邮件正文内容,然后存HTML格式,PartStream.Position := 0;
    PartStream.SaveToFile('D:\Rev.HTML');htmls.LoadFromFile('D:\Rev.HTML');
                      
    'D:\Rev.HTML',与HTML都已乱码了
      

  7.   

    PartStream读取进来的时候已经是乱了吧
      

  8.   

    Utf8ToAnsi(UTF8Encode( )) 
    你这样试下吧
      

  9.   

    htmls.Text := Utf8ToAnsi(UTF8Encode( htmls.Text)) ; 
    这样不对,
      

  10.   

    PartStream :TStringStream;读出来之后Utf8ToAnsi(PartStream.DataString);不要UTF8Encode
      

  11.   

    以前项目的代码,你看以下吧。是delphi2010的,IDHTTP获取的网页内容,分通过流读取和直接读取 try
        if SearchBookinfo.NeedStream then
        begin
          URLHTML := TStringStream.Create('', TEncoding.GetEncoding(936));
          Idhttp1.Get(SearchBookinfo.BookinfoURL, URLHTML);
          ResultStr := URLHTML.DataString;
        end
        else
          ResultStr := Idhttp1.Get(SearchBookinfo.BookinfoURL);
      except
        Idhttp1.Free;    ResultStr := '';
        if ConCount < 3 then
          Execute;
        Exit;
      end;
      Idhttp1.Free;
      if EndThread then
      begin
        Exit;
      end;下面这个是字符串转换函数function StringChange(URLStr, UTF8str, Encode: Boolean; in_str: string): string;
    begin
      Result := in_str;
      try
        if Encode then
        begin
          if URLStr then
          begin
            if UTF8str then          Result := HTTPEncode(UTF8Encode(Result))
            else
              Result := HTTPEncode(Result);
          end
          else if UTF8str then
            Result := UTF8Encode(Result);
        end
        else
        begin
          if URLStr then
          begin
            if UTF8str then
              Result := HTTPDecode(UTF8Decode(Result))
            else
              Result := UTF8Decode(Result);
          end
          else
          begin
            if UTF8str then
              Result := UTF8Decode(Result);
          end;
        end;
      except
        Result := in_str;
      end;
    end;引用 HTTPApp
      

  12.   

    注意这句
     URLHTML := TStringStream.Create('', TEncoding.GetEncoding(936));
       Idhttp1.Get(SearchBookinfo.BookinfoURL, URLHTML);
      

  13.   

    注:PartStream :TMemoryStream;这没有DataString 属性
      

  14.   


    服了你
    PartStream :TStringStream;
    或者再定义一个TStringStream从你的PartStream :TMemoryStream;读,你看着办
      

  15.   

    你现在贴的是部分utf-8,部分不知道什么编码。
    怎么回事?