"%D6%D0%CE%C4" 应该是 "中文"的GB2312 编码,但是我获取的是"%D6%D0%CE%C4" ,怎么把他转成"中文"两个字呢?
分数不多,多谢帮忙!

解决方案 »

  1.   

    %D6%D0%CE%C4
    把%改为$
    Chr($D6)+Chr($D0)...
    就是了
    代码类似
    Chr(InttoStr('$D6'))...
    具体自己弄~
      

  2.   

    var
            mStr: string;
    begin
            mStr := #$D6#$D0#$CE#$C4;
            showmessage(mStr);
    end;
      

  3.   

    可以考虑使用一下Indy Misc组件面板中的TIdQuotedPrintableDecoder控件,代码如下:
    var
      Str: String;
    begin
      Str := '%D6%D0%CE%C4';
      Str := StringReplace(Str, '%', '=', [rfReplaceAll]);//转换成=D6=D0=CE=C4格式
      IdQuotedPrintableDecoder1.CodeString(Str);
      Str := IdQuotedPrintableDecoder1.CompletedInput;
      Delete(Str, 1, 2);//去掉前两个字符
      ShowMessage(Str);
    end;
      

  4.   

    to:DunDao(Foolish)
    没有这个TIdQuotedPrintableDecoder吧
    只有TIdPrintableDecoderQuoted,但是用上去也不行啊
      

  5.   

    to:erhan(二憨) 
    具体点可以吗
      

  6.   

    你用的是delphi几,D6肯定是没问题的。
      

  7.   

    D7用这个TIdDecoderQuotedPrintablevar
      Str: String;
    begin
      Str := '%D6%D0%CE%C4';
      Str := StringReplace(Str, '%', '=', [rfReplaceAll]);
      Str := IdDecoderQuotedPrintable1.DecodeString(Str);
      ShowMessage(Str);
    end;