From: Jan N. <jan...@gm...> - 2025-04-16 12:03:52
|
Op wo 16 apr 2025 om 13:35 schreef Harald Oehlmann: > thanks for the hint. I have now replaced it with the idom introduced in > Tcl 8.0 (at least Tcl 8.4): > > Tcl_WinUtfToTChar( pStr, lStr, &sPar1); That's fine too. Tcl_WinUtfToTChar is platform-dependant (Windows-only), and works fine. The function Tcl_WinTCharToUtf() (the other way round) has the strange property that the "length" parameter must be specified in "bytes", not in WCHAR's. That's one source of confusion. Another one is that Tcl_WinUtfToTChar and Tcl_WinTCharToUtf don't accept -1 as length parameter, which should mean "until the terminating NULL". Tcl_UtfToWCharDString() is much more useful than Tcl_WinTCharToUtf(). > The migration: > https://core.tcl-lang.org/tcl/wiki?name=Migrating+C+extensions+to+Tcl+9&p > does not tell anything on this... So, that should be extended. All is described here: <https://core.tcl-lang.org/tips/doc/trunk/tip/548.md> Hope this helps, Jan Nijtmans |