StringEncodings.jl icon indicating copy to clipboard operation
StringEncodings.jl copied to clipboard

no method matching skip

Open judober opened this issue 2 years ago • 0 comments

Hello, I want to search in some text for a keyword and extract the Text beginning with the keyword to the end.

I have the following simplified example:

(path, io) = mktemp();
write(path, "Hello World!") # dummy content
readuntil(io, "World") # serach for keyword
skip(io, -5) # go back to include keyword in result
DesiredOutput = readuntil(io, "\n") # get rest of the file

However, this is not possible when working with an encoding:

io2 = open(path, enc"MS-ANSI") # open with encoding
readuntil(io2 , "World") # serach for keyword
skip(io2 , -5) # go back to include keyword in result <-- errors
DesiredOutput = readuntil(io2 , "\n") # get rest of the file

Should skip be supproted or is there a better solution for this?

judober avatar Jul 13 '23 12:07 judober