Click here to Skip to main content
14,927,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I want to convert a base64 string into a byte array with UTF-8 encoding, I am trying the following code in 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:
byte[] byteArray2=  Base64.decode(byteArray);

Please help me.

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

1 solution

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

In any case follow these links :[^]

Base64 Encoder/Decoder in C#[^]

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