Since you want feedback on unicode now, I have done a bit of testing. I did:
Use the DVBViewer Pro 4.2.0.21 beta.
Download a chinese channels.dat from a thread in this forum
Install the eastern character sets and set "language for non-unicode-programs" to Chinese (there other variants af chinese possible, haven't tested those ones) on my Danish Windows XP Pro.
Here is my code for reading and testing the DVBViewer channels in D2009:
procedure TAbstractThread.GetDVBVChannels;
var
pChannelCollection: IChannelCollection;
pFavoritesManager: IFavoritesManager;
List: OleVariant;
i, N: integer;
p: PDVBVChannel;
trEPGChannelID: TEPGChannelID;
function NewChannel(aEPGChannelID: TEPGChannelID): boolean;
var
i: integer;
p: PDVBVChannel;
begin
Result := True;
for I := 0 to DVBVChannels.Count - 1 do
begin
p := DVBVChannels[i];
if (p^.rEPGChannelID.ID = aEPGChannelID.ID) then
begin
Result := False;
Exit;
end;
end;
end;
begin //GetDVBVChannels
try
pChannelCollection := FDVBViewer.ChannelManager;
pFavoritesManager := FDVBViewer.FavoritesManager;
N := pChannelCollection.GetChannelList(List);
GLOG('Reading ' + IntToStr(N) + ' DVBViewer Channels');
for i := 0 to N - 1 do
begin
trEPGChannelID.SID := List[i,26];
trEPGChannelID.TID := List[i,23];
trEPGChannelID.NID := List[i,25];
trEPGChannelID.TunerType := List[i,4] + 1;
trEPGChannelID.Unused := 0;
if NewChannel(trEPGChannelID) and
((List[i,22] <> 0) or (List[i,20] <> 0)) then //Vidio or Audio PID <> 0
begin
New(p);
if not Assigned(p) then
begin
ThreadError := errMemGet;
raise XepgException.Create('ERROR: Out of memory');
end;
DVBVChannels.Add(p);
with p^ do
begin
rEPGChannelID := trEPGChannelID;
Root := List[i,0];
IsRadio := List[i,22] = 0; //Video PID
Category := List[i,2];
Name := List[i,1];
AddLineToMemo(List[i,1]);//<---Added to test chinese channels.dat. This line is not included in the public version
IsEncrypted := List[i,3] And 1 <> 0;
IsFavorite := pFavoritesManager.IsFavorite(rEPGChannelID.SID, List[i,20], List[i,1]);
ChannelNo := i;
end; // with p^
end;
if Terminated Then Exit;
end; //for i
except
if ThreadError = 0 then ThreadError := errReadingChannels;
raise;
end;
GLOG('Different DVBViewer Channels found :' + IntToStr(DVBVChannels.Count));
end;The channel names displayed in the TMemo are garbage unless for ansi characters.I did try to set the language in DVBViewer to both versions of chinese.
Am I doing anything wrong?
Actually the p^.Name variable is currently of type string[63] so the Xepg is NOT fully unicode enabled. Ofcourse I plan it to be. I have some other stuff I want to do, but if you want me to I can make this unicode thing priority 1. Well, even for a small tool like the Xepg this actually requires quite some recoding.
A solution not urgent to me.
This post has been edited by Delphi: 15 July 2009 - 12:45

Help














