Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:54:42+00:00 2026-05-22T14:54:42+00:00

I am decoding some text using Base64. I have tried three different libraries (commons

  • 0

I am decoding some text using
Base64. I have tried three different
libraries (commons Base64, Java.misc., and also java.mail) in Java and all
of them produce same result for the
following text, which is not right.

However when I use Ruby to decode the below string I get different output. I get the right result using Ruby.
The Ruby code is print Base64.decode64('<Below String>'), the string is

RkxWAQEAAAAJAAAAABIAAK4AAAAAAAAAAgAKb25NZXRhRGF0YQgAAAAHAAV3aWR0aABAdAAAAAAA
AAAGaGVpZ2h0AEB0AAAAAAAAAAlmcmFtZXJhdGUAQBAAAAAAAAAADHZpZGVvY29kZWNpZABACAAA
AAAAAAAMY2FuU2Vla1RvRW5kAQEAD21ldGFkYXRhY3JlYXRvcgIAKVNpbXBsZUZMVldyaXRlci5h
cyB2MC44IHplcm9wb2ludG5pbmUuY29tAAAJ

The output should start with FLV. I am not sure what I am missing and why the output is different using Java.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:54:43+00:00Added an answer on May 22, 2026 at 2:54 pm

    The result of decoding base64 is binary data. You shouldn’t really try to print it as if it were text.

    Without knowing Ruby, I’d expect the result of calling Base64.decode64 to be some sort of byte array… and that could be converted into text in any number of ways.

    Look at the bytes of what’s returned to find out whether or not it’s correct.

    (It’s unfortunate that as far as I can see, the documentation for Base64.decode64 gives examples of exactly the kind of thing you’re doing – treating the result of a base64 decode operation as text. It’s not clear what type of data is actually returned. This sort of thing is why I still like statically typed languages…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string that's encrypted using some crypto classes in Java (RSA/ECB/PKCS1Padding) and
I tried decoding this base64 string so many times but every time i get
I encoded a text in a TMemo using base64 encoding tools ( like Indy
I have some problem for decoding image data from base 64 encoded string. I
Can someone please redirect me to some good references about the encoding and decoding
I am developing a small windows app, but have some trouble deciding whether to
Is there a freely available Base64 decoding code snippet in C++?
using the below code for decoding json $categories = json_decode($data); $categories = $categories->data; where
We have a CSS file with some rules similar to the following: .directory-result ul
In my binary to text decoding application (.NET 2.0) I found that the line:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.