If you have any control over the program that writes the file it might be worthwhile seeing if it can generate something a bit easier to deal with.
CStrings are null terminated so you are possibly going to have to read a byte at a time, append to your string if it is not 0 and exit if it is. If the data is wide (UTF16/32) then you might have to read more than one byte at a time. Remember to set the text encoding correctly as well.
Reading one byte at a time from disk might be slow so an alternative could be to read it all into a memoryblock, attach another binarystream to the memoryblock and then read the memoryblock as described above. If you have the MBS plugins you might find functions that help speed up finding bytes in memoryblocks.
This has a nice method DefineEncodingByAnalysis_MTC, which should set the encoding after examining the byte mark.[/quote]
Is there a newer version, I tried to test the M_String Harness but doesn’t run, it gives error:
M_String.SqueezeB_MTC, line 30
Can’t find a type with this name
dim rx as RegExMBS = NewRegExMBS