title: How to save "Hex Data" to a file (ASCII) in CAPL including the "NULL" character (0x00)?
body: <p>In CAPL code, I have a "byte[]" array, this array is supposed to hold "Hex" values (00..FF).</p>
  
  <p>The problem is that, when I try to save the "Hex" array to a file in "ASCII" format, it completely ignores "00" (which is the "NULL" character) resulting in corrupting the output file.</p>
  
  <pre><code>variables
  {
      byte UploadedData[56, 41, 4C, 00, 01, 02, 00, 02];
      char ExportedTextFile[9];
      char FileName[32] = "FlasherImage.can";
      dword FileHandle = 0;
  }
  
  void ExportDataFile(void)
  {  
      int u16Index = 0;
  
  
      FileHandle = OpenFileWrite(FileName, 0);  
  
      for (u16Index = 0; u16Index &lt; 8; u16Index++)
      { 
          snprintf(ExportedTextFile, elcount(ExportedTextFile), "%c", UploadedData[u16Index]);
  
          filePutString(ExportedTextFile, elcount(ExportedTextFile), FileHandle);
      }
  
      fileClose(FileHandle);
  }
  </code></pre>
  
  <p>The Expected File Shall Be:
  VALNULSOHSTXNULSTX</p>
  
  <p>The Obtained File is ("NUL" is ignored):
  VALSOHSTXSTX</p>
  
  <p>where:
  V: Character 'V'.
  A: Character 'A'.
  L: Character 'L'.
  NUL: "NULL" Control Character.
  SOH: "Start Of Header" Control Character.
  STX: "Start of Text" Control Character.</p>
  
  <p>Please, help me with any solution or workaround.</p>
  
  <p>Thank you very much.</p>