tk_chooseDirectory -initialdir internationalization problem

tk_chooseDirectory -initialdir internationalization problem

Post by s-ima » Thu, 13 Mar 2008 13:15:45


Hi.

There is a problem with internationalization of "tk_chooseDirectory
-initialdir".

but "tk_getOpenFile -initialdir" and "tk_getSaveFile -initialdir" are no
problem.

Is this difference improved eventually from Tcl 8.5.2?

-----
Satoshi Imai
XXXX@XXXXX.COM
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by Gerald W. » Thu, 13 Mar 2008 23:25:38


Could you tell us what the problem is?

Did you (or someone else) file a bug report about the problem?


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by s-ima » Fri, 14 Mar 2008 09:27:05

Hi.


It seems to be a bugs from a long time ago.
"tk_chooseDirectory -initialdir" ignore specified Japanese folder.
but "tk_getOpenFile -initialdir" and "tk_getSaveFile -initialdir"
recognizes a Japanese folder right.


No. but everyone using "tk_chooseDirectory -initialdir" knows. :-)

-----
Satoshi Imai
XXXX@XXXXX.COM
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by ZB » Fri, 14 Mar 2008 20:41:36

Dnia 13.03.2008 s-imai < XXXX@XXXXX.COM > napisaa:
>> It seems to be a bugs from a long time ago. >> "tk_chooseDirectory -initialdir" ignore specified Japanese folder. >> but "tk_getOpenFile -initialdir" and "tk_getSaveFile -initialdir" >> recognizes a Japanese folder right. >> >>> Did you (or someone else) file a bug report about the problem? >> >> No. but everyone using "tk_chooseDirectory -initialdir" knows. :-)

Not sure, what you mean. Just made a try:

#v+
zb@sarge~$ tclsh
tclsh8.5 [~]package require Tk
8.5.1
tclsh8.5 [~]tk_chooseDirectory -initialdir /usr/share
#v-

...and I cannot see anything unusual. Is it something related just to
japanese translation - or one should expect a specific problem in all the
non-english version, under specific circumstances?
--
ZB
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by s-ima » Fri, 14 Mar 2008 21:42:15

Hi.

I've tried this code on Windows XP SP2(japanese).

package require Tk
tk_chooseDirectory -initialdir d:/foo/japanese_char

=> Dialog box shows "d:/foo"
It's wrong.

package require Tk
tk_getOpenFile -initialdir d:/foo/japanese_char

=> Dialog box shows "d:/foo/japanese_char"
It's right.

-----
Satoshi Imai
XXXX@XXXXX.COM
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by bitWal » Fri, 14 Mar 2008 22:27:52

Hi,
I will show examples to explain what is the problem.

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.

If this does not make sense to you, let me know please. I will explain
this symptom with some hard copies of these examples above. Thanks.

Keiichi
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by ZB » Fri, 14 Mar 2008 22:42:06

Dnia 13.03.2008 bitWalk < XXXX@XXXXX.COM > napisaa:
>> 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.

Yes, I can confirm the problem. But it's even worse in the case of polish
translation: neither tk_getOpenFile nor tk_chooseDirectory works as expected
in the case of sub-dir names containing polish non-7bit characters (tested
just under Linux at the moment).
--
ZB
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by bitWal » Fri, 14 Mar 2008 22:45:31

Hi,
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 is no problem, it works fine.

Keiichi
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by Gerald W. » Fri, 14 Mar 2008 23:30:04


These use the Windows native dialog boxes, so the error may be either in the
windows dialog or the code that is calling it.




Again, did you file a bug report at http://www.yqcomputer.com/

If not then please do so. When doing so, please include the character that
is a problem (so that the developers can duplicate it).


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by Jeff Hobb » Sat, 15 Mar 2008 03:04:32


Confirmed on XP with 8.5.1. It partially works, going to the write
dir structure, but not selecting the unicode path correctly. There is
definitely some non-unicode aware code in there. I will look into the
core sources, but this should be submitted to SF for tracking (the
above text is perfect - maybe use the \u equiv as I'm not sure SF will
do the unicode right).

Jeff
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by bitWal » Sat, 15 Mar 2008 03:37:47

Jeff,
I've submitted this problem to SF. Please check in the following
below:

https://sourceforge.net/tracker/index.php?func=detail&aid=1913750&group_id=12997&atid=112997

Regards,
Keiichi
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by USCod » Thu, 20 Mar 2008 07:13:46


Sorry Jeff, but I'm going to ask a C-ignorant question here:
Is there anyway or are there any tools available that can scan the
remaining Tcl/Tk codebase and detect if there are any other places where
some non-unicode aware code exists, like with this case? This bug
surprised me (and I'm sure yourself as well) as Tcl/Tk has been
unicode-aware for quite some time!
Just curious.
Thanks!
 
 
 

tk_chooseDirectory -initialdir internationalization problem

Post by Donal K. F » Thu, 20 Mar 2008 18:58:07


Tricky, as the unicode/system-ness of a string isn't captured in the
type (a char* is a char*, after all). Especially tricky on Windows,
where the platform API changes according to what encoding you're using.

Donal.