Welcome! Log In Create A New Profile

Advanced

[WDM25] - Encoding Base64

Posted by JP 
JP
[WDM25] - Encoding Base64
December 16, 2020 08:21PM
Hi All

WinDev Mobile 25 Android

Trying to encode a string with base64 using: sEncoded_Data = Encode( sMy_Data , encodeBASE64 )

This works fine and I get an encoded string back.

In the same app I can decode is using: Decode( sEncoded_Data , encodeBASE64 )

Also works fine. In the mobile app I get the original string back. Good.

However, if I copy the encoded string to a windows app and Base64 decode the string I get each letter of the original string seperated with a chr(0) i.e. after each letter of the original string there is a chr(0) inserted.

Now of course I can strip the chr(0) out and get my true original string but does anyone know why the chr(0) is being inserted after every character in the original string? Is it something to do with character sets in Android?

Thanks
Argus
Re: [WDM25] - Encoding Base64
December 17, 2020 01:04AM
you have a unicode vs ansi problem...

You'(ll find all the details and explanations here: [fabriceharari.com]


In this article, Fabrice is talking about the differences between working on an android device and in the emulator, but it's the same thing that you working on an android device and in windev.
JP
Re: [WDM25] - Encoding Base64
December 17, 2020 07:16AM
Thanks Argus. Got it working from that article. ANSI string.

Cheers smiling smiley
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: