Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #23300
    Sung-ik Ko
    Participant

    Hello, Mr. Emura.
    Can you please add a new feature – auto replacement from CJK Compatibility Ideographs to CJK Unified Ideographs?

    The compatibility area from U+F900..U+FAFF is still WIDELY used in Korea, but I think some Japanese people still might also use that area too.

    That makes character normalization very problematic in Korea. Only some people who happen to have to deal with DB data written in old Chinese characters come to know the problem, but almost all of them have no experience in programming or text processing. So that feature can be really, really useful especially in Korea. As far as I know, no text editors seem to support auto replacement from CJK Compatibility Ideographs to CJK Unified Ideographs, And I couldn’t find any plug -in for EmEditor. (I’m using 64bit version.)
    Anything will do whether plug-ins or built-in features,

    Sincerely.

    #23301
    Sung-ik Ko
    Participant

    p.s.

    I don’t want compulsive replacement like that of chrome or mediawiki. User selection like Traditional to Simplified Chinese would be the best way for the feature.

    #23302
    Yutaka Emura
    Keymaster

    I am sure you should be able to do just that by writing a macro. Please write specs in details if you need me to help you writing such that macro.

    #23432
    Sung-ik Ko
    Participant

    I tried to make a macro as you recommended, but I had a problem.

    my macro

    It came to a halt while dealing with just a few text files. Yes, there must be some mistakes, but I don’t know why. I am just a normal computer user and don’t know how to make a computer program, even a simple one.

    Can you teach me what I didn’t do?

    #23433
    Sung-ik Ko
    Participant

    I’m not sure if you need this one, but here’s an excel file just for your information. (if you don’t mind Korean language)

    CJK compatibiltity List

    #23441
    Makoto Emura
    Keymaster

    Yutaka says that CJK compatibility character replacement is not planned for the near future, although he does understand that it would be useful for the Korean language.

    I did revise your macro to do this, and without freezing for multiple documents, hopefully.

    Your macro works fine, but I did make some changes to make it easier to maintain, if you need to modify it later on. In Uni_CJK_2.jsee, I create a list for the conversion pairs, and loop though it. Unicode characters can be written like “\u0000” if that is useful.

    To fix the issue you had with the macro not able to process multiple files, Uni_CJK_3.jsee fixes this by opening one document at a time. It saves and closes the document when the script is finished with the document. I think it was a memory issue, so if that was the case, this should work.

    #23444
    Sung-ik Ko
    Participant

    Thank you for your help.

    Here’s what you wrote in your macro Uni_CJK_3.jsee .
    ——————
    var folderPath = “C:\\Users\\makot\\Downloads\\”; // Use double backslash to use backslash character in string

    // List of documents to process
    var docs = [
    [“test1.txt”],
    [“test2.txt”]
    ];
    ———————-
    Does it mean I have to change the folder path and the list of documents every time I work with different text file sets? If so, I’m afraid it is not very practical. Most of the time normal users open files and use ‘find & replace’ with ‘Search All Documents in the Group’ checked. Sometimes users open files from different folders. Sometimes hundreds or thousands of files from different folders. I wonder if it is too complicated a work to write a general purpose macro for that situation. if it is not a simple job, I’d better stop here.

    #23448
    Makoto Emura
    Keymaster

    I’m not exactly sure how you want to input the list of documents. I’m afraid there is no method to get a list of documents in a folder, but what you can do in File Explorer is to highlight multiple files, hold shift, right click, and select “copy as path” to get a list of documents that you can put into the script. The scripting language is designed to be simple, so it is not able to show a graphical interface.

    #23451
    Sung-ik Ko
    Participant

    This is how I want to do:

    1. open many files from multiple folders manually. (Sometimes the number can be hundreds, or thousands) . Once all files are open, I save them as a workplace for later use.

    2. convert all CJK compatible characters in the files in the workplace to unified ones automatically by the help of a macro.

    The 2nd step is what I want to do using a macro without a program halt. Is there any safe and fast way to do this using a macro?

    #23459
    Makoto Emura
    Keymaster

    I see; then using the flag eeFindReplaceOpenDoc for document.selection.Find() to search all open documents is the method to use, as you used, or in Uni_CJK_2.jsee. EmEditor does freeze when processing large documents, but it is working. If you have enough memory available in your system, turning off “Use Temporary File to Reduce Memory Usage” in Tools > Customize… > Advanced will decrease search time. When you start the script I recommend waiting for a couple hours, then come back to see if it finished.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.