#101 Strange word processor's chars autoreplace

open
nobody
None
5
2007-11-24
2007-11-24
No

Hi guys!

Did you ever try to copy and paste code from a pdf file or from a text document (expecially if produced with some creapy software) to geany (or any other sw like this) and try to compile it?
What about saving the file?

If you are lucky the compiler will complain on some misterious chars that look exaclty like " or ' but that are not the same char... you'll be unable to save the file to a charset different from UTF-8... and and if it was compiled (with lot of warnings!) generally the output looks terrible.

Much more frustrating is that also the opening " and che closing " are two different chars!!

So let's say this:
1 - when saving file fails whould be nice to know the position of the fist char that is unsupported by the particular charset you are using (so that the user can replace it by hand quickly) and retry to save...
2 - if there's a good man out there that can write an autoreplace plugin whould be great! (ask for confirmation whould be perfect or let use add/edit a list of chars that gotta be autoreplaced)

Many many thanks for attenction and much more thanks for the work you allready did to create geany!

A.

Discussion

  • Enrico Tröger

    Enrico Tröger - 2007-11-25

    Logged In: YES
    user_id=1117045
    Originator: NO

    I know the problem. But it isn't a problem of Geany but one of the PDF view program or the one which created the PDF file.
    Anyway, 1) is a good idea and I just added some code to SVN to display the first character which probably caused a failed conversion. But it only displays the character in the error dialog, if it is a whitespace it might doesn't help much. The better way would be to display the line and column where the faulty character can be found. Unfortunately, this would require some more work because we had to find the correct position by taking the difference between characters and bytes into account. Maybe I'll add this later.

    2) would be even harder because we had to know which characters should be replaced and which not.

     
  • TheDarkFreeSoul

    TheDarkFreeSoul - 2007-11-25

    Logged In: YES
    user_id=1125675
    Originator: YES

    Hi eht16,

    Yes, I see what you mean and about point 1, yes i was exaclty thinking about let user know the position of the involved char (line and column)... I just hope you or someone will find the time to do it :). If it can be usefull I inform You that BlueFish does it so, I just guess, maybe some allredy written/tested code can be used?
    About the 2 ok, it's just a dream :) I know it's not a Geany fault but most probably the guys that write PDF or word processors will never change their mind :-/
    Do you think it may be possible to organise a custom replacement script (maybe a plugin)? I mean a simple table with 2 columns. First column is what to look for and second is the replacement. So the user can write his own rules and replace everything in one single click. It should not take lot of energies I think.
    Well, let me know what you think about this :) and again, many many thanks!

     
  • Enrico Tröger

    Enrico Tröger - 2007-11-25

    Logged In: YES
    user_id=1117045
    Originator: NO

    > I inform You that BlueFish does it so, I just guess, maybe some allredy written/tested code can be used
    I'll have a look. Basically, it isn't that hard to write the code but it just needs to be done ;-).

    > Do you think it may be possible to organise a custom replacement script (maybe a plugin)? I mean a simple table with 2 columns.
    This can be already done with custom commands. See http://geany.uvena.de/manual/0.12/index.html#send-text-through-definable-commands for details. With a little scripting or even better a regular expression for sed, this should be quite easy. IMO, the real effort is in creating the table of characters and replacements.

     
  • TheDarkFreeSoul

    TheDarkFreeSoul - 2007-11-25

    Logged In: YES
    user_id=1125675
    Originator: YES

    Good good good :)
    :D

     
  • Enrico Tröger

    Enrico Tröger - 2007-11-29

    Logged In: YES
    user_id=1117045
    Originator: NO

    I added the code for display also the line and column of a failed conversion. Check SVN r2075.

     
  • TheDarkFreeSoul

    TheDarkFreeSoul - 2007-11-29

    Logged In: YES
    user_id=1125675
    Originator: YES

    Hi eht16!

    Yeah ! Great work man! many many thanks! Now I wait for next realease :)
    I know it's not the right place where to say this but... why not a RRS feed on Geany news? Ok, just an idea :)

     

Log in to post a comment.