I am trying to mimic the C# function Encoding.ASCII.GetBytes in Oracle 12c. I am nearly there but can't figure why I get the following results:
Oracle
declare
l_string varchar2(4000) := 'Test';
begin
dbms_output.put_line(utl_raw.cast_to_raw(l_string));
end;
The output from this is:
54657374
C#
internal static string ConvertTest()
{
var inputString = "Test";
Console.WriteLine(BitConverter.ToString(Encoding.ASCII.GetBytes(inputString)));
}
The output from this is:
54-65-73-74
So I seem to be nearly there but I can't figure out why C# has '-' between each byte and Oracle does not.
Is there an Oracle function to replicate the output from C#?
Thanks.