因为Delphi自带的转换函数遇到其无法识别的字符串就返回空,下面函数可解决该问题。
function DecodeUtf8Str(const S: UTF8String): WideString;
var
lenSrc, lenDst : 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;
http://www.lsworks.net/article/41.html