B4J Question how can I EncodeBase64 to textbox

Discussion in 'B4J Questions' started by sigster, Apr 6, 2015.

  1. sigster

    sigster Active Member Licensed User

    Hi

    I was using this sample to DecodeBase64
    how can I EncodeBase64 to textbox

    this is how I read from database but know I need to save to database in EncodeBase64


    Code:
    mobile = RS.GetString("mobile")
                
    Dim b() As Byte = su.DecodeBase64(mobile)
                Decode_gsm = 
    BytesToString(b, 0, b.Length, "UTF-8")
    regards
    Sigster

    http://www.b4x.com/android/forum/threads/bug-cant-decodebase64.9316/#post-254633
     
  2. imbault

    imbault Well-Known Member Licensed User

    Hi,
    It's better to save to your database in BLOB, binary, than encoded in base64, cause it will be about 4x bigger.

    Base64 is used for transfering usually, internally, binary is better

    else is:

    Code:
    Dim Encoded64 as String
    Dim Conv As ByteConverter
    Encoded64 = su.EncodeBase64(Conv.StringToBytes(Decode_gsm,
    "UTF-8"))
    ' Save the  Encoded64 into your database field
     
    Last edited: Apr 6, 2015
  3. sigster

    sigster Active Member Licensed User

    will check it out with BLOB, binary but this is only few name in the database around 30 name

    Thanks for the help

    Regards
    Sigster
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice