#170 \x doesn't work correctly in Extended mode searches

Next_release
closed
Don HO
UI (101)
7
2010-01-25
2010-01-19
cchris
No

In extended mode:
Searching for 'O' works
Searching for\x4F should do the same, but fails
Seearch for \x42 works and finds 'B'
Searching for \x4? finds 'O'

Cure:
At line 100 in FindReplaceDlg.cpp, in readBase(), replace
current = str[i];
with
current = str[i] & 0xdf; //to upper
if (current >= 'A') current -= ('A' - '0' + 10);

Discussion

  • Vikash Gupta

    Vikash Gupta - 2010-01-19

    Will this cure be useful for accented characters like é and É.?

     
  • cchris

    cchris - 2010-01-19

    OOPS make the correction at line 101 equal to ('A' - '0' - 10)
    last sign was wrong.

     
  • cchris

    cchris - 2010-01-19

    @vikash4india: yes, as long as you search for the way they are coded in your document. \x doesn't work with Unicode encodings. An extra \u(+4 hex digits) escape sequence could be useful.

     
  • Vikash Gupta

    Vikash Gupta - 2010-01-19

    i tried both \u(00E9) and \u00E9, but none is working, can u check this on your notepad++?

     
  • cchris

    cchris - 2010-01-19

    I was saying \u would be nice to have, implying that it is not implemented atm. However, if your doc is encoded in ANSI CP850, \x82 would work (bad example, it currently does) . \d130 would too.

     
  • Vikash Gupta

    Vikash Gupta - 2010-01-19

    @cchris: Oh, sorry, i thought word "could be useful" means it is already implemented.
    Thanx for information.

    Don HO, Can u update this feature (\u as escape sequence for unicode characters) in next release or later?

     
  • cchris

    cchris - 2010-01-24

    The attached patch, made against rev 601:
    * fixes \x
    * adds \u: this new escape must be followed by 4 hex digits.
    Both \x and \u take hex digits of any case, possibly mixed.

     
  • cchris

    cchris - 2010-01-24

    Corrects Ext Mode \x and adds \u

     
  • Don HO

    Don HO - 2010-01-24
    • priority: 5 --> 7
    • assigned_to: nobody --> donho
     
  • Don HO

    Don HO - 2010-01-25
    • status: open --> closed
     

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks