Bug on macro editing containing UseEncoding 65001 in UE v24.00 and v24.10 (fixed)

Bug on macro editing containing UseEncoding 65001 in UE v24.00 and v24.10 (fixed)

1
NewbieNewbie
1

    Aug 23, 2017#1

    I found bugs in UltraEdit v24.10.0.35.

    Code: Select all

    InsertMode
    ColumnModeOff
    HexOff
    PerlReOn
    ReplInFiles MatchCase RegExp Recursive UseEncoding 65001 "C:\Temp\" "*.lua" "^(step)" "\t\1"
    Adding this code to a macro changes the encoding automatically.

    UseEncoding 65001 ----> UseEncoding 43 or 5, etc.

    UltraEdit.frInFiles.encoding not working.

    Code: Select all

    UltraEdit.ueReOn();
    UltraEdit.outputWindow.clear();
    if (UltraEdit.outputWindow.visible == false) UltraEdit.outputWindow.showWindow(true);
    if (UltraEdit.document.length < 1)
    {
       UltraEdit.newFile();
    }
    UltraEdit.frInFiles.filesToSearch=0;
    UltraEdit.frInFiles.directoryStart="d:\\Temp\\*.txt";
    UltraEdit.frInFiles.useEncoding=true;
    UltraEdit.frInFiles.encoding=65001;
    UltraEdit.frInFiles.ignoreHiddenSubs=false;
    UltraEdit.frInFiles.logChanges=true;
    UltraEdit.frInFiles.matchCase=false;
    UltraEdit.frInFiles.matchWord=false;
    UltraEdit.frInFiles.preserveCase=false;
    UltraEdit.frInFiles.searchSubs=false;
    UltraEdit.frInFiles.regExp=true;
    UltraEdit.frInFiles.unicodeSearch=true;
    UltraEdit.frInFiles.useOutputWindow=true;
    UltraEdit.frInFiles.replace("files","파일");

    6,600548
    Grand MasterGrand Master
    6,600548

      Aug 23, 2017#2

      I confirm the issue with parameter UseEncoding 65001 in a macro file which results on my tests on being decoded as UseEncoding 8 on next opening the macro in Edit Macro dialog window. This issue exists according to my tests from UE v24.00.0.42 to currently latest v24.10.0.35. This issue does not exist in former versions like v22.20.0.49 or v23.20.0.43.

      Please report this issue by email to IDM support. This is a user to user forum as written at top of every forum page. Bug reports posted here have no effect on future versions of UltraEdit. I don't report this issue by email as I'm not affected by this bug for my work with UE/UES.

      Edit: This bug was fixed with UE v24.20.0.30 and UES v17.20.

      I can't reproduce any issue with scripting command UltraEdit.frInFiles using your script with code for creation of a new file removed as not needed for this script just running a Replace in Files using UE v24.00.0.42 and v24.10.0.35.

      I first saved your script as Test.txt into D:\Temp being UTF-8 encoded with BOM and once again as Test.tx to be able to restore Test.txt easily by copying Test.tx over modified Test.txt.

      Then I saved your script ANSI encoded with last line being UltraEdit.frInFiles.replace("files",String.fromCharCode(54028, 51068)); and executed the script. UTF-8 encoded Test.txt was correct modified.

      Next I converted the script to Unicode (UTF-16 LE with BOM), used as last line now UltraEdit.frInFiles.replace("files","파일");, saved it and executed the script once again after having restored original content of Test.txt. Test.txt was modified correct by having again all "files" in the file case-insensitive replaced by "파일" respectively 0xED, 0x8C, 0x8C, 0xEC, 0x9D, 0xBC.

      My next test was with script file being encoded in UTF-8 with BOM and my last test with script file encoded in UTF-8 without BOM. Both tests were successful.
      Best regards from an UC/UE/UES for Windows user from Austria