Click here to Skip to main content
15,889,359 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to convert a base64 string into a byte array with UTF-8 encoding, I am trying the following code in C#:
C#
byte[] byteArray= System.Text.Encoding.UTF8.GetBytes(resultString);

After this, I want to decode this byteArray from Base64 and store in byteArray2.
Like in java we use following:
C#
byte[] byteArray2=  Base64.decode(byteArray);

Please help me.

Thanks in advance.
Posted
Updated 30-Aug-12 0:56am
v2

1 solution

Base64 is already ASCII compatible and does not need UTF8 encoding.

In any case follow these links : http://arcanecode.com/2007/03/21/encoding-strings-to-base64-in-c/[^]

Base64 Encoder/Decoder in C#[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900