Convert UTF16 to string

Spike UK
Spike UK used Ask the Experts™
on
How can I convert a (Base 64) UTF16 string to a standard string  in vb (or C#)
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Retired
Distinguished Expert 2017
Commented:
Hi Spike UK;

This should do what you need.
// Convert the base 64 string to a byte array
byte[] fromBase64String = Convert.FromBase64String(stringAsBase64);
// Convert the byte array to a string
string convertedToString = Encoding.ASCII.GetString(fromBase64String);

Open in new window

Author

Commented:
Thanks - solved!
Fernando SotoRetired
Distinguished Expert 2017

Commented:
Not a problem Spike UK, glad to help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial