Slawek_Guzek wrote: »Why C/AL is not enough and you need .NET based solution?FOR i := 1 TO STRLEN(InText) DO BEGIN //c, UpperByte, LowerByte : Integer //UpperByteChar, LowerByteChar : Char c := InText[i]; UpperByte := c DIV 16; LowerByte := c - (UpperByte * 16); IF LowerByte < 10 THEN LowerByteChar := 48 +LowerByte ELSE LowerByteChar := 87 +LowerByte; IF UpperByte < 10 THEN UpperByteChar := 48+UpperByte ELSE UpperByteChar := 87+UpperByte; HexText += STRSUBSTNO('%%1%2', UpperByteChar, LowerByteChar); END;
string input = "Hello World!"; char[] values = input.ToCharArray(); foreach (char letter in values) { // Get the integral value of the character. int value = Convert.ToInt32(letter); // Convert the decimal value to a hexadecimal value in string form. string hexOutput = String.Format("{0:X}", value); Console.WriteLine("Hexadecimal value of {0} is {1}", letter, hexOutput); } /* Output: Hexadecimal value of H is 48 Hexadecimal value of e is 65 Hexadecimal value of l is 6C Hexadecimal value of l is 6C Hexadecimal value of o is 6F Hexadecimal value of is 20 Hexadecimal value of W is 57 Hexadecimal value of o is 6F Hexadecimal value of r is 72 Hexadecimal value of l is 6C Hexadecimal value of d is 64 Hexadecimal value of ! is 21 */
Answers
HtmlEncode method of the HttpUtility calss doesn't allow to convert the whole string in hexadecimal format but converts only a part of it
Thank you so much in advance
Michele
Are there any other updates?
Thank you so much in advance
Michele
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Because I prefer to exploit the potential that the dotNet platform offers, simply this. Thank you so much,
Michele
Because I prefer to exploit the potential that the dotNet platform offers, simply this. Thank you so much,
Michele
Source: https://docs.microsoft.com/it-it/dotnet/csharp/programming-guide/types/how-to-convert-between-hexadecimal-strings-and-numeric-types