Results 1 to 20 of 20

Thread: VB - Fast Base64 Encoding and Decoding

Hybrid View

  1. #1
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,312

    Re: VB - Fast Base64 Encoding and Decoding

    I check the code with a spanish paragraph. The problem with my example for using the encoder/decoder is about the non unicode textboxes, not the encoder/decoder. So reading Text property from text boxes you get a Utf16Le encoded string from an ansi string based on selected font/language. The same for the output which a convertion happen from Utf16Le to the selected language on output Textbox, which is the same as the input when decode the encoded string (we show this in the second textbox).

    I use this:
    ¿Queréis tener Netflix en casa 🏠, pero pagando un poco menos? La plataforma está a punto de lanzar una nueva suscripción para clientes ahorradores: el plan «Básico con Anuncios». Es igual que el plan Básico pero, como su nombre indica, contiene publicidad.
    And convert to this:
    vwBRAHUAZQByAOkAaQBzACAAdABlAG4AZQByACAATgBlAHQAZgBsAGkAeAAgAGUA
    bgAgAGMAYQBzAGEAIAA82ODfLAAgAHAAZQByAG8AIABwAGEAZwBhAG4AZABvACAA
    dQBuACAAcABvAGMAbwAgAG0AZQBuAG8AcwA/ACAATABhACAAcABsAGEAdABhAGYA
    bwByAG0AYQAgAGUAcwB0AOEAIABhACAAcAB1AG4AdABvACAAZABlACAAbABhAG4A
    egBhAHIAIAB1AG4AYQAgAG4AdQBlAHYAYQAgAHMAdQBzAGMAcgBpAHAAYwBpAPMA
    bgAgAHAAYQByAGEAIABjAGwAaQBlAG4AdABlAHMAIABhAGgAbwByAHIAYQBkAG8A
    cgBlAHMAOgAgAGUAbAAgAHAAbABhAG4AIACrAEIA4QBzAGkAYwBvACAAYwBvAG4A
    IABBAG4AdQBuAGMAaQBvAHMAuwAuACAARQBzACAAaQBnAHUAYQBsACAAcQB1AGUA
    IABlAGwAIABwAGwAYQBuACAAQgDhAHMAaQBjAG8AIABwAGUAcgBvACwAIABjAG8A
    bQBvACAAcwB1ACAAbgBvAG0AYgByAGUAIABpAG4AZABpAGMAYQAsACAAYwBvAG4A
    dABpAGUAbgBlACAAcAB1AGIAbABpAGMAaQBkAGEAZAAuAA==

    Here is the code in M2000 Interpreter which use the same encoder/decoder. You can see the funtions here: https://github.com/M2000Interpreter/.../main/pipe.bas

    Name:  sample64.jpg
Views: 3863
Size:  73.8 KB

    The textbox of M2000 is a unicode textbox (which I create). So there is no convertion to Ansi.

    You can check the output here (as you see, you have to inform that the encoding is Utf16LE:
    Name:  sample64_2.jpg
Views: 3965
Size:  84.9 KB
    Last edited by georgekar; Oct 18th, 2022 at 09:23 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width