#14 The editor.replace() function doesn't work on big documents


I wrote a script (attached to this bug report) with the intent to automate replacing some fancy Unicode characters with their simple ASCII equivalents in txt and html documents. The script works fine on small files, (no problems encountered up to 100kb), but some larger books are simply blanked or replaced with 1-2 characters. (Seen quotation marks ("), apostrophes ('), and dashes (--) so far.) And occasionally I will find a chunk of it missing.

The issue is reproducible with those books, if I undo and try again.
But if I fill a file with megabytes of randomness the replace function still works on that.
However, if I add a couple of the characters I am looking to replace to that random document, it suddenly gets a chunk bitten out of it by the plugin.


  • 3ICE

    3ICE - 2012-02-21

    The script I am trying to run on ebooks

  • Dave Brotherstone

    • Group: --> v1.0
  • Dave Brotherstone

    Fixed in v1.0

    I can't obviously test that in your case (with your books), it still works, but when 1.0 is released (should be this weekend), you're welcome to test it. The replace() and rereplace() have been rewritten to be faster, and not break on large documents or when many replacements are performed, so I would hope that it will work with the new version.

  • Dave Brotherstone

    • status: open --> closed-fixed

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks