-
-
Save ztirom/9f4917d8416c2f417e744150f908f3eb to your computer and use it in GitHub Desktop.
Make a byte64 String from an UTF-8 String in AX2012
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void strToBase64Str(Args _args) | |
{ | |
System.Byte[] byte; | |
str str64 = "QVgyMDEyUjNDVTk=", | |
strUTF8Output; | |
System.Text.Encoding encoding = System.Text.Encoding::get_UTF8(); | |
// base64 Input | |
byte = System.Convert::FromBase64String(str64); | |
// UTF8 output | |
strUTF8Output = encoding.GetString(byte); | |
// result | |
info(strFmt("base64: %1", str64)); | |
info(strFmt("UTF8 output: %1", strUTF8Output)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment