@onlinestatements
Oh my goodness - I just realized there is a simple solution for reading files with null bytes without using the /M option
It is the Windows Script Host's TextStream.ReadLine method that is unable to read binary data with null bytes. But JREPL already gives you the option to read/write files via ADO instead of TextStream. ADO has no problem reading the binary data with null bytes
So you can drop the /M option and use ADO by appending the correct character set name to the file name. For example, if your input is ASCII, then you can simply use
Code: Select all
jrepl "search" "replace" ...options... /F "input.txt|ascii"
You can also use ADO for the output, but it is not necessary - TextStream.WriteLine has no problem writing null bytes.
I need to update the JREPL documentation to account for this issue. Currently the docs say binary input requires the /M option.
Dave Benham