str:=#0+'9'+#0+'5'+#0+'8'+'~'+#207+'m'+'N' 是 '958经济'的unicode编码
请问怎么转换成普通的char编码

解决方案 »

  1.   

    试试这个:Converts a string of Unicode characters into a UTF-8 string.UnitSystemCategorycharacter set conversionsfunction UnicodeToUtf8(Dest: PChar; MaxDestBytes: Cardinal; Source: PWideChar; SourceChars: Cardinal): Cardinal; overload;
    function UnicodeToUtf8(Dest: PChar; Source: PWideChar; MaxBytes: Integer): Integer;overload
    ; deprecated;DescriptionCall UnicodeToUtf8 to convert a Unicode string to a null-terminated sequence of UTF-8 characters.Dest receives the resulting null-terminated array of UTF-8 characters.MaxDestBytes or MaxBytes indicates the number of bytes available in the buffer specified by Dest, not counting the byte for the null terminator. Source is an array of Unicode characters.SourceChars is the number of characters in Source. If SourceChars is not specified, Source must be null-terminated.UnicodeToUtf8 returns the number of bytes written to Dest.
      

  2.   

    to zfmich
    我也看到了这个,正在试着怎么用呢
    UnicodeToUtf8(Pchar(Buffers[n].Msg_Content[i]),PWideChar(RecInfo^.Msg_Content[i]),160) 
    可不知道怎么用,请指教