Hi there,
its almost 10 years ago I stopped programming in Delphi and now I want to start in Lazarus again. Back in these days I wrote an application to store the information of my Mini-DV video tapes. The video directory contains a list of tapes where each tape has a list of titles which holds all scenes in a list belonging to that title. Every scenes is stored as an MKV file. Because I am using digiKam now to archive all information I don't need my old application any more. But I want to keep the information. So I thought to store the MKV's in the file structure where e.g. the title is a folder. And I want to store the scene's description inside the MKV using ffmpeg. And here is the point where I got lost: the conversion from old string into the new unicode world - at least for me it is new :-). When I do read the old strings they have the "?" sign where ever I used one of the German special characters like ÄäÖöÜüß and I don't know how to convert it so I can use it as e.g. a folder name. This is the code I used to store the title information:
procedure TTitel.Store(var FS : TFileStream);
var AnzahlItems : Integer;
i, l : Integer;
ASzene : TSzene;
begin
AnzahlItems := pred(Szenenliste.Count);
l := Length(Titel);
FS.Write(l, SizeOf(l));
FS.Write(Titel[1], l);
FS.Write(AnzahlItems, SizeOf(AnzahlItems));
for I := 0 to AnzahlItems do
begin
ASzene := TSzene(Szenenliste.Items[i]);
ASzene.Store(FS);
end;
end;
where Titel is defined in the TTitle class as a string.
Reading a titel is done with this method:
Constructor TTitel.CreateFromStream(var FS : TFileStream; AParent : TTape);
var AnzahlItems : Integer;
i,l : Integer;
ASzene : TSzene;
begin
inherited Create;
Parent := AParent;
Szenenliste := TList.Create;
FS.Read(l, sizeOf(l));
SetLength(Titel, l); // then the string itself
FS.Read(Titel[1], l);
FS.Read(AnzahlItems, sizeOf(AnzahlItems));
for i := 0 to AnzahlItems do
begin
ASzene := TSzene.CreateFromStream(FS, Self);
Szenenliste.Add(ASzene);
end;
if TCF then Parent.TCF := True;
end;
To visualize the titles I use a treeview component and add nodes with the title string. And these nodes contain the "?" signs I want to get rid of, but don't know how. I am pretty sure you know it right away
Many thx. in advanced!