Bug reports

English main discussion
  • Author
  • Message
Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

KDJ wrote:Let's do the test: "Cycle search" turn on, search down and up (F3, Shift+F3).
Regular expressions for test:

Code: Select all

^
$
^$
\b
\B
Text for test:

Code: Select all

RegExp test - boundary


Test version

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Instructor
Super, now it works better than in all other editors.

KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

A small correction.
If the text is terminated by new line character, the following regular expressions:
^
$
\B
should match up to the end of text.

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »


KDJ
Offline
Posts: 1949
Joined: Sat Mar 06, 2010 7:40 pm
Location: Poland

Post by KDJ »

Instructor
Well done!

Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Replace button not work

Post by cnnnc »

AkelPad 4.8.0
OS: XP SP3

I like to convert following:

Code: Select all

acb
dfe
gih
into:

Code: Select all

abc
def
ghi
So I call ReplaceDialog and tpye find:

Code: Select all

^(\w)(\w)(\w)$
replace:

Code: Select all

\1\3\2
Opt: RegExp+Beginning

Then I click "Replace" button, but its action just same as "Find Next" button's.

BTW, the "Replace All" button works OK.

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »


Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Test vision(2012-11-20 20:34) is OK. Thanks!

Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

There are 17 chars that StatusUserFormat "%cl:%cH" no show anything, 1 Zero char and 16 Surrogate pair Chars, below is their EscapeValue:

Code: Select all

%00
%uD800%uDC00
%uD840%uDC00
%uD880%uDC00
%uD8C0%uDC00
%uD900%uDC00
%uD940%uDC00
%uD980%uDC00
%uD9C0%uDC00
%uDA00%uDC00
%uDA40%uDC00
%uDA80%uDC00
%uDAC0%uDC00
%uDB00%uDC00
%uDB40%uDC00
%uDB80%uDC00
%uDBC0%uDC00
all of their Hex value is:

Code: Select all

\u0000
\u010000
\u020000
\u030000
\u040000
\u050000
\u060000
\u070000
\u080000
\u090000
\u0a0000
\u0b0000
\u0c0000
\u0d0000
\u0e0000
\u0f0000
\u100000
In order to get the original text, copy the EscapeValue text to AkelPad, run SearchReplace.js, Find:

Code: Select all

(.*)
Replace with:

Code: Select all

return unescape($1);
Options:

Code: Select all

[v]RegExp
[v]MultiLine
[v]Replace with function
(*)Beginning
Then click ReplaceAll.
Well, put caret at the beginning of every line, you will see nothing about the section of "%cl:%cH" on the StateBar.

Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Hmm, I made "%cl" and "%cH" separately not in one block, it seem OK now.

It seems that I found a bug about save file from ULE(Unicode_LE) to GB18030(54936).
In order to get the text to test, please run

Code: Select all

// Generate all Unicode characters, including extended characters.

try {
  var hMainWnd=AkelPad.GetMainWnd();
}
catch (oError) {
  WScript.Quit();
}

var oSys     =AkelPad.SystemFunction();
var nAkelEdit=AkelPad.IsAkelEdit();
var hWndEdit =AkelPad.GetEditWnd();

SetRedraw(hWndEdit, false);

var vChar=[];

for (i=0x0000;i<=0x0FFF;i+=1) {
  x=i.toString(16);
  vChar.push(unescape("\%u" + "000".substr(0, 4-x.length)+x));
}

for (i=0x1000;i<=0xD7FF;i+=1) {
  vChar.push(unescape("\%u" + i.toString(16)));
}

for (i=0xE000;i<=0xFFFF;i+=1) {
  vChar.push(unescape("\%u" + i.toString(16)));
}

x=null;
i=null;
CollectGarbage();

// Generate extended characters.
for (i=0xd800;i<=0xDBFF;i+=1) {
  x=i.toString(16);
  for (j=0xDC00;j<=0xDFFF;j+=1) {
    vChar.push(unescape("%u" + x + "%u" + j.toString(16)));
  }
}

x=null;
i=null;
j=null;

SetRedraw(hWndEdit, true);

AkelPad.ReplaceSel(vChar.join("\n"));

vChar=null;
CollectGarbage();


function SetRedraw(hWnd, bRedraw) {
  if (nAkelEdit) {
    AkelPad.SendMessage(hWnd, 3185 /*AEM_LOCKSCROLL*/, 3 /*SB_BOTH*/, !bRedraw);
  }

  AkelPad.SendMessage(hWnd, 11 /*WM_SETREDRAW*/, bRedraw, 0);
  if (bRedraw) {
    oSys.Call("user32::InvalidateRect", hWnd, 0, true);
  }
}
.
Save that into file in ULE codepage.
Then Find "?" without any checkbox. there only one "?" exist. It's OK.
Save as the file in codepage GB18030(54936), then Find "?" again, still OK?
Yes, it seem OK.
Then reopen the file and Find "?" again, you will find that there is 42 general chars and 1024 surrogate pair chars become dirty.

The same save action in BabelPad 6.2.0.3 is OK.

Another bug, I had set the default codepage from GBK(936) to GB18030(54936), and had restarted AkelPad. But when I open a ANSI file autodect, AkelPad open it in GBK(936), even I deleted GBK(936) from filter list.
_____________
AkelPad 4.8.0+
WinXP SP3 ChineseSimplified

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »

cnnnc wrote:It seems that I found a bug about save file from ULE(Unicode_LE) to GB18030(54936).
Test version
Another bug, I had set the default codepage from GBK(936) to GB18030(54936), and had restarted AkelPad. But when I open a ANSI file autodect, AkelPad open it in GBK(936), even I deleted GBK(936) from filter list.
Autodetection proceeds with hardcoded codepages you cannot change them.

Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Instructor wrote:
cnnnc wrote:It seems that I found a bug about save file from ULE(Unicode_LE) to GB18030(54936).
Test version
Yes, the bug is fixed. Thanks!

Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

It seems there still a bug about save file from ULE(Unicode_LE) to GB18030(54936).
In order to get the text to test, please run UnicodeCharGen.js but a little change the:

Code: Select all

AkelPad.ReplaceSel(vChar.join("\n "));
Save that into file in ULE codepage.
Then Find "?" without any checkbox. there only one "?" exist. It's OK.
Save as the file in codepage GB18030(54936), then Find "?" again, still OK?
Yes, it seem OK.
Then reopen the file and Find "?" again, you will find that there is 512 surrogate pair chars become dirty. They look rules:
\u0101b3 ... \u0109b3
\u0111b3 ... \u0119b3
...
\u10F1B3 ... \u10F9B3
The same save action in BabelPad 6.2.0.3 is OK.

There not only these surrogate pair chars become dirty, some others generated in some other actual cases, but they are not look rules.
_____________
AkelPad 4.8.1+
WinXP SP3 ChineseSimplified

Offline
Site Admin
Posts: 6311
Joined: Thu Jul 06, 2006 7:20 am

Post by Instructor »


Offline
Posts: 119
Joined: Sat Jan 12, 2008 10:16 am
Location: Shantou, China

Post by cnnnc »

Instructor wrote:cnnnc
Test version
This test version still exist bug.
\u0101b3 ... \u0109b3
\u0111b3 ... \u0119b3
...
\u10F1B3 ... \u10F9B3
OK now, but there is another 1024 surrogate pair chars become dirty. They look rules:
\u0102C5...\u0106C5...\u010AC5...\u010EC5
\u0112C5...\u0116C5...\u011AC5...\u011EC5
...
\u10F2C5...\u10F6C5...\u10FAC5...\u10FEC5
Post Reply