I'm throwing together a program as a refresher for VB.net, and I figured I might as well make it do something that I have to do a lot anyways: Convert an input string into UTF-16LE and then into Base64.
Now, in PHP, I can do it like this:
<?php
$UTF8_String = "example string";
$UTF16_String = mb_convert_encoding($UTF8_String,"UTF-16LE","UTF-8");
$base64_encoded = base64_encode($UTF16_String);
echo $base64_encoded;
Sweet and simple.
...but in vb.net, I can't figure out how to get the string from
Dim strInput = inputBox.Text
convert it to UTF-16LE (it has to be UTF-16LE), and then the convert the resulting string to Base64.
Thank you!
Edit: Gserg and Steven's code both works equally well, and it helps to seeing two methods of converting text: One with specifiable encoding and one with Unicode. Steven's answer is more complete at this time, so I'll accept it. Thank you!