Atozed Forums
Fix to eliminate iconv for android (and other unix-es) - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Open Source (https://www.atozed.com/forums/forum-19.html)
+--- Forum: Indy (https://www.atozed.com/forums/forum-9.html)
+--- Thread: Fix to eliminate iconv for android (and other unix-es) (/thread-2269.html)

Pages: 1 2 3


RE: Fix to eliminate iconv for android (and other unix-es) - rlebeau - 02-01-2021

(02-01-2021, 10:17 PM)ZGabrovski@gmail.com Wrote: OK, but why this code has no problem with android 8/9, only fails with Android 10?

I can't answer that, as I'm not a FPC developer, or an Android 9/10 user (my phone has Android 8). You are going to have to debug the issue for yourself. In the meantime, I'm considering your proposed change, though I'm going to make some tweaks to it before merging it into Indy's main code.


RE: Fix to eliminate iconv for android (and other unix-es) - rlebeau - 02-02-2021

(02-01-2021, 11:45 PM)rlebeau Wrote: In the meantime, I'm considering your proposed change, though I'm going to make some tweaks to it before merging it into Indy's main code.

Attached are the tweaks I have made so far.  Let me know if they work.


RE: Fix to eliminate iconv for android (and other unix-es) - ZGabrovski@gmail.com - 02-05-2021

(02-02-2021, 01:22 AM)rlebeau Wrote:
(02-01-2021, 11:45 PM)rlebeau Wrote: In the meantime, I'm considering your proposed change, though I'm going to make some tweaks to it before merging it into Indy's main code.

Attached are the tweaks I have made so far.  Let me know if they work.

Sorry for the late reply.
It is not working well.
I will investigate where the problems come from, but this will take some time.

Regards,
Zdravko

Please, find attached file with bugs fixed. Now it works.
Not testing under Android, later on I will test. Test under Ubuntu linux.
I am no expecting the problems under android, if then function "SetSrting" terminates the string with #0 and string length will be OK.
But I will test tonight just in case.

Regards,
Zdravko


RE: Fix to eliminate iconv for android (and other unix-es) - rlebeau - 02-05-2021

(02-05-2021, 06:36 AM)ZGabrovski@gmail.com Wrote: Please, find attached file with bugs fixed. Now it works.

I have made further tweaks.  See attached, as well as checked in to a GitHub branch.  I suggest you work from that branch from now on, you are getting out of sync with Indy's main code.

(02-05-2021, 06:36 AM)ZGabrovski@gmail.com Wrote: I am no expecting the problems under android, if then function "SetSrting" terminates the string with #0 and string length will be OK.
But I will test tonight just in case.

Yes, SetString() guarantees the output string is null-terminated properly.


RE: Fix to eliminate iconv for android (and other unix-es) - ZGabrovski@gmail.com - 02-06-2021

Unfortunately there is a problem under Android. I will need time to digg where the problem comes form.
Regards, Zdravko


RE: Fix to eliminate iconv for android (and other unix-es) - ZGabrovski@gmail.com - 02-07-2021

Now fixed, works fine under ANDROID.
'ansi' encoding must be in exceptions (in both two functions).
Code:
  if PosInStrArray(ACharSet, ['UTF-8', 'UTF8', 'ansi'], False) <> -1 then begin {do not localize}

Please, find attached fixed file.

Regards,
Zdravko


RE: Fix to eliminate iconv for android (and other unix-es) - rlebeau - 02-09-2021

(02-07-2021, 09:16 PM)ZGabrovski@gmail.com Wrote: Now fixed, works fine under ANDROID.
'ansi' encoding must be in exceptions (in both two functions).

I have tweaked the fix and checked it in to Indy's LConvEnc branch on GitHub.


RE: Fix to eliminate iconv for android (and other unix-es) - rlebeau - 02-13-2021

(02-09-2021, 02:53 AM)rlebeau Wrote: I have tweaked the fix and checked it in to Indy's LConvEnc branch on GitHub.

Any further issues with this code? Or is it ready to be merged into the main code?


RE: Fix to eliminate iconv for android (and other unix-es) - ZGabrovski@gmail.com - 02-14-2021

Sorry for the delay I will test and inform you.


RE: Fix to eliminate iconv for android (and other unix-es) - ZGabrovski@gmail.com - 02-15-2021

Everything is OK, works perfect. You can merge with main branch. Zdravko.