Menu

#2708 wish/tclsh unable run in directories with non-Latin chars

obsolete: 8.5.13
closed-fixed
99. Other (73)
5
2013-01-08
2009-11-15
No

To reproduce the bug:

1. Create a directory: C:\软件 (or any directory name with non-Latin1 characters)
2. Edit a new file with Notepad: C:\软件\test.tcl with content: tk_messageBox -message "Hullo world!"
3. Save the file and double-click it in Windows Explorer.

Result: "couldn't read file "C:\??\test.tcl": no such file or directory."

Platform tested with: Windows XP SP3.

Discussion

  • Pawel Pawlak

    Pawel Pawlak - 2009-11-16

    It is not completely true. Non-Latin1 characters do not always cause failure - only those, that fall off the current ANSI codepage. For example, on Polish WinXP I can successfully execute C:\ąę\test.tcl, but Wish fails to open C:\деревня\test.tcl - in the first example all characters can be represented in codepage 1250, which is not the case in the second example.

     
  • Don Porter

    Don Porter - 2009-11-16

    So the problem is that [encoding system] cannot encode
    all the characters found on the system?

     
  • Pawel Pawlak

    Pawel Pawlak - 2009-11-16

    I think the problem is that WinMain is an ANSI function (argv is char**), so the command line comes in ANSI version (C-runtime does this, I think).

    This is not a single function change, I'm afraid. You can easily call GetCommandLineW to get UNICODE command line version, but what next? Tk_MainEx is, again, ANSI - so conversion is needed - and again out-of-codepage characters will be lost.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2009-11-16

    davygrvy recognized the WinMain issue and there should be another outstanding bug with perhaps a patch that discusses this further.

     
  • Jan Nijtmans

    Jan Nijtmans - 2012-04-06
    • assigned_to: nobody --> nijtmans
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-04-06
    • milestone: 898759 --> 2101547
     
  • Jan Nijtmans

    Jan Nijtmans - 2012-04-06

    This should be fixed with Tcl/Tk 8.6

     
  • Jan Nijtmans

    Jan Nijtmans - 2013-01-08
    • milestone: 2101547 --> obsolete: 8.5.13
    • status: open --> closed-fixed
     
  • Jan Nijtmans

    Jan Nijtmans - 2013-01-08

    Fixed in Tk 8.6.0