Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fix to eliminate iconv for android (and other unix-es)
#11
(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.

Reply
#12
(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.


Attached Files
.zip   FixedUnits2.zip (Size: 78.36 KB / Downloads: 3)

Reply
#13
(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


Attached Files
.zip   IdGlobal.pas.zip (Size: 61.6 KB / Downloads: 3)
Reply
#14
(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.


Attached Files
.zip   IdGlobal.pas 2.zip (Size: 65.83 KB / Downloads: 3)

Reply
#15
Unfortunately there is a problem under Android. I will need time to digg where the problem comes form.
Regards, Zdravko
Reply
#16
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


Attached Files
.zip   IdGlobal.zip (Size: 62.45 KB / Downloads: 3)
Reply
#17
(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.

Reply
#18
(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?

Reply
#19
Sorry for the delay I will test and inform you.
Reply
#20
Everything is OK, works perfect. You can merge with main branch. Zdravko.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)