You've already forked lazarus-ccr
* 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:
@ -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');
|
||||
|
Reference in New Issue
Block a user