[fpc-pascal] Android and cwstring

Sven Barth pascaldragon at googlemail.com
Wed Jul 31 20:51:26 CEST 2013


On 31.07.2013 20:35, Felipe Monteiro de Carvalho wrote:
> On Wed, Jul 31, 2013 at 3:11 PM, Torsten Bonde Christiansen
> <tc at epidata.info> wrote:
>> More specifically i cannot get the library to use the "cwstring" unit. Below
>> you see a working example of a library that works fine (the log entry is
>> generated) when cwstring i commented out, but when included the android
>> application just hangs on the message:
>
> Doesn't cwstring link to the iconv library? If yes, then I guess you
> can give up on using it on Android. There is no iconv available in
> Android for 3rd party applications. The list of available libraries is
> very small, I described it here for API level 8 which is what I
> usually set as my minimum requisite:
> http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#NDK_Libraries_available_in_Android_2.2_.28API_level_8.29

The cwstring of Android uses the ICU library libicuuc.so.

> Anyway, I wrote a 100% Pascal widestring manager implementation which
> works in Android, it is available in the Lazarus source tree, here:
> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/components/lazutils/paswstring.pas?view=markup&revision=41389&root=lazarus
>
> You can copy it to your project and use it.
>

FPC 2.7.1 also contains a Pascal only widestring manager called 
fpwidestring. You'll need to add additional units for the required 
codepages though. They are called collation_LANGUAGE (e.g. collation_de).

Regards,
Sven



More information about the fpc-pascal mailing list