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)
commit087b06187ceff43e2fb4299a0da24c6f694e3672 (patch)
tree48ec1343fc6ca9728a2517a528e68601413c1c88 /win/tclWin32Dll.c
parent529b7e026c99752ee4d072259f7c701fbfe470a8 (diff)
downloadtcl-087b06187ceff43e2fb4299a0da24c6f694e3672.zip
tcl-087b06187ceff43e2fb4299a0da24c6f694e3672.tar.gz
tcl-087b06187ceff43e2fb4299a0da24c6f694e3672.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) */
/*
*------------------------------------------------------------------------