StringIndexError some time comes unexpectedly

StringIndexError some time comes unexpectedly.

Does anybody have this type of error? How to deal with it.
I just do the next code to solve the problem, just change the index from 701 to 702 =)). Does anybody suggest other solutions?

return page[1:end-701+f-3]
return page[1:end-702+f-3]

You have to be careful when indexing into strings in Julia. It is important to understand that certain characters can take up more than one index, and therefore errors can occur if you blindly assume that every page[i] is valid.
This section of the manual should help you come up with a solution to your problem:

1 Like

Thank you so much.