Click here to Skip to main content
13,045,540 members (70,485 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have a base 64 string like this:


I want to convert this string to normal string

Please, can any one help me?

I have already used two methods:
byte[] encodedDataAsBytes
                = System.Convert.FromBase64String(data);
            string returnValue =
            return returnValue;

byte[] b = Convert.FromBase64String(data);
 string strOriginal = System.Text.Encoding.UTF8.GetString(b);
 return strOriginal;

but this methods not converting into normal format of string
Posted 28-Mar-11 19:22pm
Updated 28-Mar-11 19:24pm
Amund Gjersøe 30-Mar-11 9:22am
Where did you get the string you want to convert, and are you really sure it is only base64-converted? Is the text written in arabic encoding?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

ASCII encoding and UTF decoding?!

Use following instead-
public string DecodeBase64String(string encodedData)
byte[] encodedDataAsBytes = System.Convert.FromBase64String(encodedData);
string returnValue = System.Text.ASCIIEncoding.ASCII.GetString(encodedDataAsBytes);
return returnValue;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 29 Mar 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100