Skip to content

Instantly share code, notes, and snippets.

@ztirom
Last active April 22, 2016 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ztirom/8f9a2f981d0ec41d467abc5c5f371291 to your computer and use it in GitHub Desktop.
Save ztirom/8f9a2f981d0ec41d467abc5c5f371291 to your computer and use it in GitHub Desktop.
Make a byte64 String from an UTF-8 String in AX2012
static void strToBase64Str(Args _args)
{
System.Byte[] byte;
str strUTF8Input = "AX2012R3CU9",
str64;
System.Text.Encoding encoding = System.Text.Encoding::get_UTF8();
// UTF8 input
byte = encoding.GetBytes(strUTF8Input);
// base64 Output
str64 = System.Convert::ToBase64String(byte);
// result
info(strFmt("UTF8 input: %1", strUTF8Input));
info(strFmt("base64: %1", str64));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment