Closed Bug 421471 Opened 16 years ago Closed 16 years ago

nsiCommandLine Does Not Handle Chinese Characters Properly

Categories

(Toolkit :: Startup and Profile System, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: sunhaitao, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Build Identifier: 2008030609

Flag parameters and arguments including Chinese characters are treated as empty string.

Flags including Chinese characters are treated as non-flag arguments.


Reproducible: Always

Steps to Reproduce:
1. Build a XUL application which retrieves command line arguments with the following code:

    var commandLine = window.arguments[0];

    var output = "";
    output += ("上下: {" + commandLine.handleFlag("上下", false) + "}\n");
    output += ("UpDn: {" + commandLine.handleFlag("UpDn", false) + "}\n");
    output += ("上: {" + commandLine.handleFlagWithParam("上", false) + "}\n");
    output += ("下: {" + commandLine.handleFlagWithParam("下", false) + "}\n");
    output += ("Up: {" + commandLine.handleFlagWithParam("Up", false) + "}\n");
    output += ("Dn: {" + commandLine.handleFlagWithParam("Dn", false) + "}\n");

    for (var i = 0; i < commandLine.length; i++) {
        output += ("Argument " + i + ": {" + commandLine.getArgument(i) + "}\n");
    }

    alert(output);

2. Run this application with following arguments:
    -上下 -UpDn -上 Up -下 下 -Up 上 -Dn Dn Argument 参数

Actual Results:  
The following message pops up:

    上下: {false}
    UpDn: {true}
    上: {null}
    下: {null}
    Up: {}
    Dn: {Dn}
    Argument 0: {}
    Argument 1: {}
    Argument 2: {Up}
    Argument 3: {}
    Argument 4: {}
    Argument 5: {Argument}
    Argument 6: {}


Expected Results:  
The following message pops up:

    上下: {true}
    UpDn: {true}
    上: {Up}
    下: {下}
    Up: {上}
    Dn: {Dn}
    Argument 0: {Argument}
    Argument 1: {参数}


Expected results can be obtained when there is an existing instance of the application.
This almost certainly got fixed on trunk by bug 396052... can you try a trunk build please?
Component: XULRunner → XRE Startup
QA Contact: xulrunner → xre.startup
It works fine after replacing "prism.exe" from Prism 0.8 with "xulrunner-stub.exe" from the trunk build. Thanks.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
Component: XRE Startup → Startup and Profile System
QA Contact: xre.startup → startup
You need to log in before you can comment on or make changes to this bug.