Tk Source Code

View Ticket
Login
Ticket UUID: 1913750
Title: tk_chooseDirectory -initialdir internationalization problem
Type: Bug Version: obsolete: 8.5.10
Submitter: bitwalk Created on: 2008-03-13 18:32:03
Subsystem: 36. [tk_chooseDirectory] Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2013-06-07 08:53:06
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2013-06-07 08:53:06
Description:
The problem can be observed when we use the Japanese name for the folder name.

For example:

tk_getOpenFile -initialdir [file join $env(HOME) "テスト"]

This works fine, the dialog opens $env(HOME)/テスト

"テスト" is a folder written in Japanese.

However,

tk_chooseDirectory -initialdir [file join $env(HOME) "テスト"]

This does not work properly.

The dialog does not indicate $env(HOME)/テスト but indicates $env(HOME) and a part of "テスト" is ignored.

This problem can be observed on Windows version of Tcl/Tk.
On UNIX version, this may not be observed, at least on Fedora 8, there seems no problem, it works fine. Thanks.

Keiichi
User Comments: jan.nijtmans added on 2013-06-07 08:53:06:
Fix is now backported to core-8-5-branch too.

nijtmans added on 2012-02-25 15:13:31:
Fixed in trunk.

Keeping open, for backport to Tk 8.5

nijtmans added on 2012-02-18 04:50:23:
Finally got the time to modify tkWinDialog.c to use the UNICODE
variants of various Win32 functions. This should finally
fix this bug, and this is IMHO the correct way this
should be tackled....

Proposed fix committed in branch bug-1913750.

Testing by anyone appreciated. If everything
works (my testing indicates is does!), I am
considering to backport this to Tk 8.5 as well,
which is more complicated because we
need UNICODE and char variants of
everything, like the other dialogs.

Jeff, Thomas, bitwalk, please test.

thomasmenez added on 2011-10-13 04:27:01:
Hi ! I've attempted a fix for another bug [3163893].
Could you please verify that the bug is still there with this patch ?
It might actually kill two birds with one stone.
I don't have any japanese keyboard to test this fix.
thx !

bitwalk added on 2010-08-13 13:27:35:
Hi,
Actually I modified the original patch uni-choosedir-1913750.patch to uni-choosedir-1913750-8.6b1.2.patch for 8.6 source as I uploaded. But this does not work. I am afraid something missing...
Keiichi

bitwalk added on 2010-08-13 13:24:18:

File Added - 383250: uni-choosedir-1913750-8.6b1.2.patch

hobbs added on 2010-08-13 11:51:01:
Does that attached patch correct the issue for you?

bitwalk added on 2010-08-13 11:03:59:
Hi,
I've checked the problem on Windows XP SP3.
Tcl and Tk are obtained from nightly CVS, tcl-20100811 and tk-20100811 and these were cross compiled using MinGW gcc on Fedora 13.

Unfortunately, nothing changed. Exact the same symptom is observed.
This is just update for confirming the problem. I will look into the source anyway when I have time. Thanks.

Keiichi

bitwalk added on 2010-08-12 23:57:57:
Hi,
Please give me more time to check this problem, since I don't have Windows environment at this moment but Linux only. I will update it soon.

Keiichi

dgp added on 2010-08-12 23:14:07:
status?

hobbs added on 2009-03-26 05:50:55:

File Added - 319611: uni-choosedir-1913750.patch

hobbs added on 2009-03-26 05:50:12:
The problem is the chooseDir stuff is not properly handling the unicode side of things.  It is relying on proper TCHAR behavior that is sending around ascii unexpectedly (I think it should all be unicode ...).  I've attached a patch that fixes things, but isn't "correct" in terms of warnings and possible system compatibility.  We don't need to support Win9x anymore, but I'm not sure what this might do on WinCE.

patthoyts added on 2008-11-24 05:23:10:
reproduced this on a Russian Windows XP system with 8.6 and 8.5.5
also on Vista (English) but with a unicode folder name.

dkf added on 2008-05-14 16:06:11:
Logged In: YES 
user_id=79902
Originator: NO

zbignew_b: That's an unrelated bug - the Linux dialogs share virtually no code with the Win dialogs - please file separately.

zbigniew_b added on 2008-03-14 04:04:44:
Logged In: YES 
user_id=1724570
Originator: NO

Same here related to console using iso8859-2 encoding. For example:

zb@sarge~$ mkdir żółw
zb@sarge~$ tclsh
tclsh8.5 [~]package require Tk
8.5.1
tclsh8.5 [~]tk_getOpenFile -initialdir [file join $env(HOME) "żółw"]
tclsh8.5 [~]tk_getOpenFile -initialdir [file join $env(HOME) "bbb"]

The first tk_getOpenFile won't include the "żółw" sub-dir - while the second one will be OK. Similar problem is with tk_chooseDirectory and tk_getSaveFile.

But quite opposite to the original poster's troubles - the problems described above occured under Linux; under Windows' control all seems to be OK.

Attachments: