* Add ContentToText and ContentToUnicode for backward compatibility

* Advanced demo: fix compilation and add ability to save as UTF-8

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1044 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blikblum
2009-12-12 20:21:04 +00:00
parent f5021d5d6a
commit 00fcff257a
3 changed files with 30 additions and 6 deletions

View File

@ -489,7 +489,7 @@ const
var
S: string;
WS: UTF8String;
WS: WideString;
Data: Pointer;
DataSize: Cardinal;
TargetName: string;
@ -500,6 +500,7 @@ begin
if Execute then
begin
TargetName := FileName;
writeln('Filter Index: ', FilterIndex);
case FilterIndex of
1: // HTML
begin
@ -530,6 +531,13 @@ begin
Data := PChar(S);
DataSize := Length(S);
end;
5: // Unicode UTF-8 text file
begin
TargetName := ChangeFileExt(TargetName, '.txt');
S := VST2.ContentToUTF8(tstVisible, #9);
Data := PChar(S);
DataSize := Length(S);
end;
else
// Plain text file
TargetName := ChangeFileExt(TargetName, '.txt');