Artifacts Associated With Ticket 473946ffffffffffffffffffffffffffffffffff
Ticket change [6ac449f288] (rid 128209) by jmphilippe on 2001-10-23 06:45:58:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I'm using Tcl 8.3.3 as a DDE server under Windows and I encounter problems with special characters. If a text variable is created by tcl, requesting the variable content doesn't give the correct string for special characters. For example, you have a text file that contains a text with the copyright sign: {test string: ©} You load that file in tcl (which converts it to unicode I assume) and get back its content with a DDERequest, then you get (and I hope I'm not the only one): {test string: ©}, and that's the same for every "exotic" character. I tried with different DDE client (Excel VB, Matlab and Aphelion, an image processing software), all give the same result. I also tried to change character encoding with no success (with 'encoding system' and 'encoding convertto'). Characters seem to be always sent as unicode. Note that when the DDE client creates a string in tcl (with something like 'DDEExecute DDE_Id, {set Texte blabla}'), it gets exactly the same text while requesting the variable (with 'DDERequest DDE_Id, Texte') whatever the string is. Things get wrong only when the string is created by tcl. - foundin initialized to: "obsolete: 8.3.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "jmphilippe"
- subsystem initialized to: "28. dde Package"
- title initialized to: "special characters not correctly sent"
- type initialized to: "Bug"
Ticket change [c5e166bc82] (rid 121662) by jmphilippe on 2002-10-09 16:28:58:
- closedate changed to: "2002-10-09T09:28:58"
- closer changed to: "jmphilippe"
- icomment:
Logged In: YES user_id=134307 Download the tclWinDde.c attached to bug #620541, and recompile the dde package.
- login: "jmphilippe"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "jmphilippe"
Ticket change [33372f4524] (rid 106548) by nijtmans on 2012-05-07 04:45:43:
- icomment:
Having a look
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [b30363663f] (rid 98443) by nijtmans on 2012-05-07 04:45:44:
- assignee changed to: "nijtmans"
- resolution changed to: "None"
- status changed to: "Open"
Ticket change [f77f5f3cac] (rid 91385) by dkf on 2012-05-07 13:57:25:
- icomment:
It's bizarre to look at it now; the somewhat uncertain handling of Unicode by SF over the years (i.e., it changed at some point) has mangled the bug report itself...
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [525996145c] (rid 126303) by nijtmans on 2012-05-07 14:13:12:
- assignee changed to: "dkf"
Ticket change [4e7f0e6cf4] (rid 125648) by nijtmans on 2012-05-07 14:51:55:
- icomment:
jmphilippe's proposal from #620541 committed to bug-473946 branch. Donal, what do you think about it?
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [0ae193f223] (rid 113896) by dkf on 2012-05-07 15:46:15:
- assignee changed to: "nijtmans"
- icomment:
Seems to be on the right sort of lines (can't test; wrong platform). Key questions to my thinking: When communicating with other Tcl processes, should we transfer as Unicode, UTF-8 or [encoding system]? What about when communicating with other processes? With those sorted out, the implementation strategy should just follow.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [2b76a08b5d] (rid 118750) by sebres on 2012-05-07 16:12:01:
- icomment:
I think it ' s ok. By CP_WINANSI it's definitely a system encoding... But it would be smart to use iCodePage = CP_WINUNICODE. http://msdn.microsoft.com/en-us/library/windows/desktop/ms648763%28v=vs.85%29.aspx So you can transfer all characters (ex. russian chars on german windows).
- login: "sebres"
- mimetype: "text/plain"
- username: "sebres"
- icomment:
Ticket change [c5e503beb2] (rid 121665) by nijtmans on 2012-05-07 20:33:05:
- icomment:
OK, I'll give a shot at a complete implementation, starting with jmphilippe's patch. For the actual data, the CF_TEXT clipboard format is used. On WIN2000 this should be changed to CF_UNICODETEXT. Windows can do an automatic conversion between those two. Yes, I consider it a bug. the CF_TEXT format assumes the system encoding, but Tcl is putting UTF-8 in it. When sending a message from Tcl to Tcl, this doesn't matter. But when other applications try to interpret this UTF-8 as sytem encoding, different characters arise. jmphilippe's patch only handled one way: from Tcl to external applications. But the reverse should be handled as well.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [0dca78cae2] (rid 114423) by nijtmans on 2012-05-09 15:55:44:
- icomment:
Better fix, derived from jmphilippe's now committed to: ******* branch "bug-473946" ******* Tested with word2007, setting a Tcl variable "test" to "€" and then trying to retreive it from word, using a field like {DDEAUTO TclEval test test}. Works! The advantage of using CF_UNICODETEXT is that it works for all chacacters. Tcl itself continues to use CF_TEXT for its communication, sending UTF-8 over it, so all current tests continue to function as normal. CF_UNICODETEXT is only used when an external application requests it. So, this is 100% upwards compatble. Please test/evaluate anyone interested. I plan to merge this to core-8-4-branch, core-8-5-branch and trunk in a few days. - login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [dc5f8d8a35] (rid 114467) by nijtmans on 2012-05-10 02:20:59:
- icomment:
Better fix, using the Tcl_GetUnicode* functions in stead of the Tcl_Win functions, so we no longer have to detect whether we are on WinNT+. It should now work equally on Win95 too. Version updated to "1.2.5" I think it's ready to be merged to all other branches
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [5c20ad5d86] (rid 118443) by nijtmans on 2012-05-10 05:02:02:
- icomment:
> Key questions to my thinking: When communicating with other Tcl processes, > should we transfer as Unicode, UTF-8 or [encoding system]? What about when > communicating with other processes? OK, let's sort that out. Currently, Tcl always comminucates in dde using the CF_TEXT clipboard format, which is meant for [encoding system]. But Tcl sends UTF-8 over this. That's OK, when Tcl is at both ends. Most other applications (e.g. Word) communicate in CF_UNICODETEXT, which assumes Unicode. When both dde ends use a different clipboard format, Windows translates it automatically, and that's where the problem arises: This translation assumes the [system encoding], but in reality it's UTF-8. Bug #473946 is solved (in the branch) by letting Tcl do the translation. Tcl now understands both CF_TEXT and CF_UNICODETEXT, and when it receives a request for CF_UNICODETEXT it will send the answer in the requested format directly. This fixes the situation that Tcl handles de dde server size while any other application handles the client side. So, what to do when Tcl is the dde client. communicating with another dde server? Then Tcl should communicate in CF_UNICODETEXT then. But how can Tcl know whether the other size is Tcl or not? I think that starting with Tcl 8.6, All dde communications should be in CF_UNICODETEXT, unless an external client (e.g. Tcl 8.5) request differently. Then Tcl doesn't have to know what's on the other side, and doesn't need to provide an encoding. If an external client requests CF_TEXT, then Tcl can safely assume that it's communication with an older Tcl dde server, because no-one else still does that ;-). This way, TIP #106 is simply not necessary any more....
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [9c31cb5012] (rid 111245) by nijtmans on 2012-05-11 05:15:18:
- closedate changed to: "2012-05-10T22:15:18"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 Now fixed in core-8-4-branch, core-8-5-branch and trunk.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "nijtmans"
Ticket change [47579143f6] (rid 99684) by nijtmans on 2012-05-11 13:53:59:
- icomment:
Just one remark. The original patch suggestion was from Miguel Baсуn, not from JM. Philippe.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [9e940df9eb] (rid 96499) by nijtmans on 2012-05-11 13:54:13:
- icomment:
allow_comments - 0
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [7a62625703] (rid 90307) by nijtmans on 2012-05-25 15:15:07:
- icomment:
Another addition: The original committed fix was only for XTYP_REQUEST, but the same can happen for XTYP_EXECUTE as well. Improved fix committed to all branches
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment: