Tk Source Code

Check-in [cbb1a6c9]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Don't re-reference encoding "unicode", when we can re-use the encoding.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256: cbb1a6c974c116b1d931fef4e3b146f7a0cbacede07eaccb4cfd13893a8bf37d
User & Date: jan.nijtmans 2019-06-19 13:35:21.694
Context
2019-06-20
12:39
Don't use wcslen() in combination with Tcl_WinTCharToUtf(): Using -1 has the same effect already (it even was wrong in tkWinTest.c's previous commit, forgot to multiply with sizeof(WCHAR)). check-in: 85a33e2a user: jan.nijtmans tags: core-8-6-branch
2019-06-19
15:27
Merge 8.6. Code cleanup, possible because we know we are compiling in UNICODE mode on Windows. check-in: 61cdcacd user: jan.nijtmans tags: trunk
14:08
Use available "ucs2-be" encoding on X11 and "utf-16" encoding on Win32, if provided by Tcl (TIP #547). If Tcl doesn't provide those encodings, proceed as usual. Closed-Leaf check-in: 472fafa9 user: jan.nijtmans tags: tip-547
13:35
Don't re-reference encoding "unicode", when we can re-use the encoding. check-in: cbb1a6c9 user: jan.nijtmans tags: core-8-6-branch
09:35
Re-generate unix/configure with autoconf 2.59, just as in core-8-6-10-rc branch, as it should be. check-in: ab38ffa0 user: jan.nijtmans tags: core-8-6-branch
Changes
Unified Diff Ignore Whitespace Patch
Changes to win/tkWinFont.c.
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
	 * some other location.
	 */

	encoding = Tcl_GetEncoding(NULL, faceName);
    }

    if (encoding == NULL) {
	encoding = Tcl_GetEncoding(NULL, "unicode");
	familyPtr->textOutProc =
	    (BOOL (WINAPI *)(HDC, int, int, TCHAR *, int)) TextOutW;
	familyPtr->getTextExtentPoint32Proc =
	    (BOOL (WINAPI *)(HDC, TCHAR *, int, LPSIZE)) GetTextExtentPoint32W;
	familyPtr->isWideFont = 1;
    } else {
	familyPtr->textOutProc =







|







1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
	 * some other location.
	 */

	encoding = Tcl_GetEncoding(NULL, faceName);
    }

    if (encoding == NULL) {
	encoding = TkWinGetUnicodeEncoding();
	familyPtr->textOutProc =
	    (BOOL (WINAPI *)(HDC, int, int, TCHAR *, int)) TextOutW;
	familyPtr->getTextExtentPoint32Proc =
	    (BOOL (WINAPI *)(HDC, TCHAR *, int, LPSIZE)) GetTextExtentPoint32W;
	familyPtr->isWideFont = 1;
    } else {
	familyPtr->textOutProc =
Changes to win/tkWinTest.c.
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
	if (error == ERROR_CALL_NOT_IMPLEMENTED) {
	    strcpy(msgBuf, "function not supported under Win32s");
	} else {
	    sprintf(msgBuf, "unknown error: %ld", error);
	}
	msg = msgBuf;
    } else {
	Tcl_Encoding encoding;
	char *msgPtr;

	encoding = Tcl_GetEncoding(NULL, "unicode");
	Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds);
	Tcl_FreeEncoding(encoding);
	LocalFree(wMsgPtr);

	msgPtr = Tcl_DStringValue(&ds);
	length = Tcl_DStringLength(&ds);

	/*
	 * Trim the trailing CR/LF from the system message.







<


<
|
<







171
172
173
174
175
176
177

178
179

180

181
182
183
184
185
186
187
	if (error == ERROR_CALL_NOT_IMPLEMENTED) {
	    strcpy(msgBuf, "function not supported under Win32s");
	} else {
	    sprintf(msgBuf, "unknown error: %ld", error);
	}
	msg = msgBuf;
    } else {

	char *msgPtr;


	Tcl_WinTCharToUtf(wMsgPtr, wcslen(wMsgPtr), &ds);

	LocalFree(wMsgPtr);

	msgPtr = Tcl_DStringValue(&ds);
	length = Tcl_DStringLength(&ds);

	/*
	 * Trim the trailing CR/LF from the system message.