summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-03 19:48:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-06-03 19:48:14 (GMT)
commit9a414590a633c4fa914a125b8eaaf187c13423f8 (patch)
tree48ec1343fc6ca9728a2517a528e68601413c1c88 /win/tclWin32Dll.c
parenta7ec180fc75e299b71f6d839da636eff3528a713 (diff)
downloadtcl-9a414590a633c4fa914a125b8eaaf187c13423f8.zip
tcl-9a414590a633c4fa914a125b8eaaf187c13423f8.tar.gz
tcl-9a414590a633c4fa914a125b8eaaf187c13423f8.tar.bz2
TIP #548: Deprecate Tcl_WinUtfToTChar() and Tcl_WinTCharToUtf() and provide more flexible replacement functions
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 36205e1..4867c24 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -463,6 +463,7 @@ TclWinDriveLetterForVolMountPoint(
*---------------------------------------------------------------------------
*/
+#if (TCL_UTF_MAX <= 4) && !defined(TCL_NO_DEPRECATED)
WCHAR *
Tcl_WinUtfToTChar(
const char *string, /* Source string in UTF-8. */
@@ -475,7 +476,7 @@ Tcl_WinUtfToTChar(
if (!string) {
return NULL;
}
- return TclUtfToWCharDString(string, len, dsPtr);
+ return Tcl_UtfToUtf16DString(string, len, dsPtr);
}
char *
@@ -490,13 +491,12 @@ Tcl_WinTCharToUtf(
if (!string) {
return NULL;
}
- if (len < 0) {
- len = wcslen((WCHAR *)string);
- } else {
+ if (len > 0) {
len /= 2;
}
- return TclWCharToUtfDString((unsigned short *)string, len, dsPtr);
+ return Tcl_Utf16ToUtfDString((unsigned short *)string, len, dsPtr);
}
+#endif /* !defined(TCL_NO_DEPRECATED) */
/*
*------------------------------------------------------------------------