0

I have an xml document encoded in base64 when i decode using the following code i get \n and \ characters everywhere

    string returnedcodes = Encoding.UTF8.GetString(Convert.FromBase64String(RejectReasonnodes));

    returnedcodes = returnedcodes.Replace("\n", "");

this has removed this character but cannot do this for the \

so if i use an online base64 decoder i get the following

<Header adviceNumber="999" currentProcessingDate="2019-04-05" reportType="REFT1019">    

and using the code i get

<Header adviceNumber=\"999\" currentProcessingDate=\"2019-04-05\" reportType=\"REFT1019\">  

this is just one line of many but the other lines contain data i cannot share but all have same character in

i have tried as many ways as i could find searching google but nothing seems to work

any advice im not looking for a coded answer just to be pointed in the right direction

thanks

  • 4
    In the debugger you will see \" instead of " if you inspect the variable, is that the confusion? – Alex K. Apr 24 '19 at 12:05
  • If you want to see it unescaped - have a look at https://stackoverflow.com/questions/18759324/can-the-visual-studio-debugger-display-strings-unquoted-unescaped – Rand Random Apr 24 '19 at 12:07
  • Where are you seeing this? The `\n` is the C/C#/C++ representation of a newline, and the `\\` is an escape character usually seen before a quote/double quote character, only in the IDE or debugger. – Ken White Apr 24 '19 at 12:24

0 Answers0