You've already forked lazarus-ccr
PowerPDF, convert UTF-8 to ANSI, currently it doesn't support more..
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@717 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1055,14 +1055,19 @@ const
|
|||||||
var
|
var
|
||||||
i, j: integer;
|
i, j: integer;
|
||||||
flg: boolean;
|
flg: boolean;
|
||||||
|
S: string;
|
||||||
begin
|
begin
|
||||||
// If text contains chars to need escape, replace text using "\".
|
// If text contains chars to need escape, replace text using "\".
|
||||||
|
//
|
||||||
|
// TODO: implement UNICODE support in powerpdf. Currently we can't do
|
||||||
|
// any better than converting utf-8 strings to unicode.
|
||||||
|
S := UTF8ToAnsi(Value);
|
||||||
result := '';
|
result := '';
|
||||||
for i := 1 to Length(Value) do
|
for i := 1 to Length(S) do
|
||||||
begin
|
begin
|
||||||
flg := false;
|
flg := false;
|
||||||
for j := 1 to Length(EscapeChars) do
|
for j := 1 to Length(EscapeChars) do
|
||||||
if Value[i] = EscapeChars[j] then
|
if S[i] = EscapeChars[j] then
|
||||||
begin
|
begin
|
||||||
result := result + '\' + ReplaceChars[j];
|
result := result + '\' + ReplaceChars[j];
|
||||||
flg := true;
|
flg := true;
|
||||||
@ -1070,7 +1075,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
if not flg then
|
if not flg then
|
||||||
result := result + Value[i];
|
result := result + S[i];
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
<CompilerPath Value="$(CompPath)"/>
|
<CompilerPath Value="$(CompPath)"/>
|
||||||
</Other>
|
</Other>
|
||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Version Minor="9"/>
|
<Version Minor="9" Release="1"/>
|
||||||
<Files Count="12">
|
<Files Count="12">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="PdfTypes.pas"/>
|
<Filename Value="PdfTypes.pas"/>
|
||||||
|
Reference in New Issue
Block a user