I do not have Delphi 2006, so I tested the code on Delphi 2007; you should:
convert a string with the characters "%" to a regular UTF8 string;
convert a UTF8 string to a broadcast string (UTF8Decode);
converts Wide String to Ansi String with Japanese encoding (WideCharToMultiByte):
const
SrcStr = 'file://localhost/G:/test/%E6%B0%97%E3%81%BE%E3%81%90%E3%82%8C%E3%83%AD%E3%83%9E%E3%83%B3%E3%83%86%E3%82%A3%E3%83%83%E3%82%AF.mp3';
function Src2Utf8(const S: string): string;
var
I: Integer;
S1: string;
B: Byte;
begin
I:= 0;
Result:= '';
SetLength(S1, 3);
S1[1]:= '$';
while I < Length(S) do begin
Inc(I);
if S[I] <> Char('%') then Result:= Result + S[I]
else begin
Inc(I);
S1[2]:= S[I];
Inc(I);
S1[3]:= S[I];
B:= StrToInt(S1);
Result:= Result + Char(B);
end;
end;
end;
procedure TForm8.Button1Click(Sender: TObject);
var
S: WideString;
S1: string;
begin
S:= Utf8Decode(Src2Utf8(SrcStr));
SetLength(S1, 4 * Length(S));
FillChar(PChar(S1)^, Length(S1), 0);
WideCharToMultiByte(932 {shift-jis codepage}, 0, PWideChar(S), Length(S),
PChar(S1), Length(S1), nil, nil);
S1:= PChar(S1);
Label1.Caption:= S1;
end;
, , '@', 90 . "Arial Unicode MS" SHIFTJIS_CHARSET () .