mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 06:20:17 +02:00
lconvencoding: simplified using iconvenc, define EnableIconvEnc if you want to use iconvenc
git-svn-id: trunk@33916 -
This commit is contained in:
parent
3ec95f8d25
commit
d468336cbb
@ -18,15 +18,9 @@ unit LConvEncoding;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{$DEFINE DisableIconv}
|
|
||||||
|
|
||||||
{$IFNDEF DisableIconv}
|
|
||||||
{$IFDEF UNIX}{$IF not defined(VER2_2_0) and not defined(VER2_2_2)}{$DEFINE HasIconvEnc}{$ENDIF}{$ENDIF}
|
|
||||||
{$ENDIF}
|
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Classes, dos, LazUTF8
|
SysUtils, Classes, dos, LazUTF8
|
||||||
{$IFDEF HasIconvEnc},iconvenc{$ENDIF};
|
{$IFDEF EnableIconvEnc},iconvenc{$ENDIF};
|
||||||
const
|
const
|
||||||
EncodingUTF8 = 'utf8';
|
EncodingUTF8 = 'utf8';
|
||||||
EncodingAnsi = 'ansi';
|
EncodingAnsi = 'ansi';
|
||||||
@ -6344,7 +6338,7 @@ function ConvertEncoding(const s, FromEncoding, ToEncoding: string): string;
|
|||||||
var
|
var
|
||||||
AFrom, ATo, SysEnc : String;
|
AFrom, ATo, SysEnc : String;
|
||||||
Encoded : Boolean;
|
Encoded : Boolean;
|
||||||
{$ifdef HasIconvEnc}
|
{$ifdef EnableIconvEnc}
|
||||||
Dummy: String;
|
Dummy: String;
|
||||||
{$endif}
|
{$endif}
|
||||||
begin
|
begin
|
||||||
@ -6655,7 +6649,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
Result:=s;
|
Result:=s;
|
||||||
{$ifdef HasIconvEnc}
|
{$ifdef EnableIconvEnc}
|
||||||
try
|
try
|
||||||
if not IconvLibFound and not InitIconv(Dummy) then
|
if not IconvLibFound and not InitIconv(Dummy) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user