summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-19 14:08:44 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-19 14:08:44 (GMT)
commit5f5dec875b76abf0a55e531de9d358ba5b34485f (patch)
tree60a74042807f27c3a0efa85c2e7b7c4cfabc4498 /win
parent59237b6ac5e62f44c6451465d76f19bb3c97469b (diff)
downloadtk-5f5dec875b76abf0a55e531de9d358ba5b34485f.zip
tk-5f5dec875b76abf0a55e531de9d358ba5b34485f.tar.gz
tk-5f5dec875b76abf0a55e531de9d358ba5b34485f.tar.bz2
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.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinX.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win/tkWinX.c b/win/tkWinX.c
index 75064b5..e7428e5 100644
--- a/win/tkWinX.c
+++ b/win/tkWinX.c
@@ -1594,7 +1594,10 @@ Tcl_Encoding
TkWinGetUnicodeEncoding(void)
{
if (unicodeEncoding == NULL) {
- unicodeEncoding = Tcl_GetEncoding(NULL, "unicode");
+ unicodeEncoding = Tcl_GetEncoding(NULL, "utf-16");
+ if (unicodeEncoding == NULL) {
+ unicodeEncoding = Tcl_GetEncoding(NULL, "unicode");
+ }
}
return unicodeEncoding;
}