diff options
author | ashok <ashok> | 2015-03-02 08:54:14 (GMT) |
---|---|---|
committer | ashok <ashok> | 2015-03-02 08:54:14 (GMT) |
commit | dfc57be3b18b7f7e023eb104bbc321809dc93429 (patch) | |
tree | dea9f61ed63f9c9f9a7ce784d6cd03b7e7986f33 /doc/Encoding.3 | |
parent | 8104f5f53df16c73196450563e867f62798448e1 (diff) | |
download | tcl-dfc57be3b18b7f7e023eb104bbc321809dc93429.zip tcl-dfc57be3b18b7f7e023eb104bbc321809dc93429.tar.gz tcl-dfc57be3b18b7f7e023eb104bbc321809dc93429.tar.bz2 |
Deleted Win95/98-specific documentation as those platforms have long been unsupported.
Diffstat (limited to 'doc/Encoding.3')
-rw-r--r-- | doc/Encoding.3 | 48 |
1 files changed, 7 insertions, 41 deletions
diff --git a/doc/Encoding.3 b/doc/Encoding.3 index 1478c35..6664b3b 100644 --- a/doc/Encoding.3 +++ b/doc/Encoding.3 @@ -257,47 +257,13 @@ is filled with the corresponding number of bytes that were stored in .PP \fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR are Windows-only convenience -functions for converting between UTF-8 and Windows strings. On Windows 95 -(as with the Unix operating system), -all strings exchanged between Tcl and the operating system are -.QW "char" -based. On Windows NT, some strings exchanged between Tcl and the -operating system are -.QW "char" -oriented while others are in Unicode. By -convention, in Windows a TCHAR is a character in the ANSI code page -on Windows 95 and a Unicode character on Windows NT. -.PP -If you planned to use the same -.QW "char" -based interfaces on both Windows -95 and Windows NT, you could use \fBTcl_UtfToExternal\fR and -\fBTcl_ExternalToUtf\fR (or their \fBTcl_DString\fR equivalents) with an -encoding of NULL (the current system encoding). On the other hand, -if you planned to use the Unicode interface when running on Windows NT -and the -.QW "char" -interfaces when running on Windows 95, you would have -to perform the following type of test over and over in your program -(as represented in pseudo-code): -.PP -.CS -if (running NT) { - encoding <- Tcl_GetEncoding("unicode"); - nativeBuffer <- Tcl_UtfToExternal(encoding, utfBuffer); - Tcl_FreeEncoding(encoding); -} else { - nativeBuffer <- Tcl_UtfToExternal(NULL, utfBuffer); -} -.CE -.PP -\fBTcl_WinUtfToTChar\fR and \fBTcl_WinTCharToUtf\fR automatically -handle this test and use the proper encoding based on the current -operating system. \fBTcl_WinUtfToTChar\fR returns a pointer to -a TCHAR string, and \fBTcl_WinTCharToUtf\fR expects a TCHAR string -pointer as the \fIsrc\fR string. Otherwise, these functions -behave identically to \fBTcl_UtfToExternalDString\fR and -\fBTcl_ExternalToUtfDString\fR. +functions for converting between UTF-8 and Windows strings +based on the TCHAR type which is by convention +a Unicode character on Windows NT. +These functions are essentially wrappers around +\fBTcl_UtfToExternalDString\fR and +\fBTcl_ExternalToUtfDString\fR that convert to and from the +Unicode encoding. .PP \fBTcl_GetEncodingName\fR is roughly the inverse of \fBTcl_GetEncoding\fR. Given an \fIencoding\fR, the return value is the \fIname\fR argument that |