From 90ddd046bc058bbe2e096e895fcee62ba83bf5dc Mon Sep 17 00:00:00 2001 From: pierre Date: Mon, 7 Dec 2009 16:57:12 +0000 Subject: [PATCH] * Use default functions if call to iconv_open failed git-svn-id: trunk@14352 - --- rtl/unix/cwstring.pp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rtl/unix/cwstring.pp b/rtl/unix/cwstring.pp index 08362eb954..ea395f465f 100644 --- a/rtl/unix/cwstring.pp +++ b/rtl/unix/cwstring.pp @@ -181,6 +181,11 @@ procedure Wide2AnsiMove(source:pwidechar;var dest:ansistring;len:SizeInt); my0 : size_t; err: cint; begin + if PtrInt(iconv_wide2ansi)=-1 then + begin + DefaultUnicode2AnsiMove(source,dest,len); + exit; + end; mynil:=nil; my0:=0; { rought estimation } @@ -240,6 +245,12 @@ procedure Ansi2WideMove(source:pchar;var dest:widestring;len:SizeInt); my0 : size_t; err: cint; begin + if PtrInt(iconv_ansi2wide)=-1 then + begin + DefaultAnsi2UnicodeMove(source,dest,len); + exit; + end; + mynil:=nil; my0:=0; // extra space