@@ -78,11 +78,11 @@ Name of encoding to get token for.
7878Points to storage where encoding token is to be written.
7979.AP " const char" *src in
8080For the \fB Tcl_ExternalToUtf \fR functions, an array of bytes in the
81- specified encoding that are to be converted to UTF -8. For the
82- \fB Tcl_UtfToExternal \fR function, an array of
83- UTF-8 characters to be converted to the specified encoding.
81+ specified encoding that are to be converted to TUTF -8. For the
82+ \fB Tcl_UtfToExternal \fR function, a TUTF-8 byte sequence
83+ to be converted to the specified encoding.
8484.AP " const TCHAR" *tsrc in
85- An array of Windows TCHAR characters to convert to UTF -8.
85+ An array of Windows TCHAR characters to convert to TUTF -8.
8686.AP Tcl_Size srcLen in
8787Length of \fI src \fR or \fI tsrc \fR in bytes. If the length is negative, the
8888encoding-specific length of the string is used.
@@ -104,7 +104,6 @@ control the encoding profile to be used for dealing with invalid data or
104104other errors in the encoding transform.
105105The flag \fB TCL_ENCODING_STOPONERROR \fR has no effect,
106106it only has meaning in Tcl 8.x.
107- .PP
108107Some flags bits may not be usable with some functions as noted in the
109108function descriptions below.
110109.AP Tcl_EncodingState *statePtr in/out
@@ -146,25 +145,24 @@ A path to the location of the encoding file.
146145.BE
147146.SH INTRODUCTION
148147.PP
149- These routines convert between Tcl's internal character representation,
150- UTF-8, and character representations used by various operating systems or
151- file systems, such as Unicode, ASCII, or Shift-JIS. When operating on
152- strings, such as such as obtaining the names of files or displaying
153- characters using international fonts, the strings must be translated into
154- one or possibly multiple formats that the various system calls can use. For
155- instance, on a Japanese Unix workstation, a user might obtain a filename
156- represented in the EUC-JP file encoding and then translate the characters to
157- the jisx0208 font encoding in order to display the filename in a Tk widget.
158- The purpose of the encoding package is to help bridge the translation gap.
159- UTF-8 provides an intermediate staging ground for all the various
160- encodings. In the example above, text would be translated into UTF-8 from
161- whatever file encoding the operating system is using. Then it would be
162- translated from UTF-8 into whatever font encoding the display routines
163- require.
164- .PP
165- Some basic encodings are compiled into Tcl. Others can be defined by the
166- user or dynamically loaded from encoding files in a
167- platform-independent manner.
148+ N.B. Refer to the \fB Tcl_UniChar \fR documentation page for a description of the
149+ \fI TUTF-8 \fR encoding and related terms referenced here.
150+ .PP
151+ These routines convert between TUTF-8
152+ and character representations using encodings such as
153+ standard UTF-8, UTF-16, ASCII, or Shift-JIS that might be expected by system
154+ interfaces or other software components. For instance, on a Japanese Unix
155+ workstation, a user might obtain a filename represented in the EUC-JP file
156+ encoding and then translate the characters to the jisx0208 font encoding in
157+ order to display the filename in a Tk widget. The purpose of the encoding
158+ package is to help bridge the translation gap. TUTF-8 provides an intermediate
159+ staging ground for all the various encodings. In the example above, text would
160+ be translated into TUTF-8 from whatever file encoding the operating system is
161+ using. Then it would be translated from TUTF-8 into whatever font encoding the
162+ display routines require.
163+ .PP
164+ Some basic encodings are compiled into Tcl. Others can be defined by the user or
165+ dynamically loaded from encoding files in a platform-independent manner.
168166.SH DESCRIPTION
169167.PP
170168\fB Tcl_GetEncoding \fR finds an encoding given its \fI name \fR . The name may
@@ -202,7 +200,7 @@ on the resulting encoding token when that token will no longer be
202200used.
203201.PP
204202\fB Tcl_ExternalToUtfDString \fR converts a source buffer \fI src \fR from the
205- specified \fI encoding \fR into UTF -8. The converted bytes are stored in
203+ specified \fI encoding \fR into TUTF -8. The converted bytes are stored in
206204\fI dstPtr \fR , which is then null-terminated. The caller should eventually
207205call \fB Tcl_DStringFree \fR to free any information stored in \fI dstPtr \fR .
208206When converting, if any of the characters in the source buffer cannot be
@@ -231,7 +229,7 @@ The caller must call \fBTcl_DStringFree\fR to free up the \fB*dstPtr\fR resource
231229irrespective of the return value from the function.
232230.PP
233231\fB Tcl_ExternalToUtf \fR converts a source buffer \fI src \fR from the specified
234- \fI encoding \fR into UTF -8. Up to \fI srcLen \fR bytes are converted from the
232+ \fI encoding \fR into TUTF -8. Up to \fI srcLen \fR bytes are converted from the
235233source buffer and up to \fI dstLen \fR converted bytes are stored in \fI dst \fR .
236234In all cases, \fI *srcReadPtr \fR is filled with the number of bytes that were
237235successfully converted from \fI src \fR and \fI *dstWrotePtr \fR is filled with
@@ -259,7 +257,7 @@ The source buffer contained a character that could not be represented in
259257the target encoding.
260258.RE
261259.LP
262- \fB Tcl_UtfToExternalDString \fR converts a source buffer \fI src \fR from UTF -8
260+ \fB Tcl_UtfToExternalDString \fR converts a source buffer \fI src \fR from TUTF -8
263261into the specified \fI encoding \fR . The converted bytes are stored in
264262\fI dstPtr \fR , which is then terminated with the appropriate encoding-specific
265263null. The caller should eventually call \fB Tcl_DStringFree \fR to free any
@@ -269,7 +267,7 @@ encoding, a default fallback character will be used. The return value is
269267a pointer to the value stored in the DString.
270268.PP
271269\fB Tcl_UtfToExternalDStringEx \fR is an enhanced version of
272- \fB Tcl_UtfToExternalDString \fR that transforms UTF -8 encoded source data to a
270+ \fB Tcl_UtfToExternalDString \fR that transforms TUTF -8 encoded source data to a
273271specified \fI encoding \fR . Except for the direction of the transform, the
274272parameters and return values are identical to those of
275273\fB Tcl_ExternalToUtfDStringEx \fR . See
@@ -278,7 +276,7 @@ that function above for details about the same.
278276Irrespective of the return code from the function, the caller must free
279277resources associated with \fB *dstPtr \fR when the function returns.
280278.PP
281- \fB Tcl_UtfToExternal \fR converts a source buffer \fI src \fR from UTF -8 into
279+ \fB Tcl_UtfToExternal \fR converts a source buffer \fI src \fR from TUTF -8 into
282280the specified \fI encoding \fR . Up to \fI srcLen \fR bytes are converted from
283281the source buffer and up to \fI dstLen \fR converted bytes are stored in
284282\fI dst \fR . In all cases, \fI *srcReadPtr \fR is filled with the number of
@@ -322,7 +320,7 @@ exist.
322320.PP
323321\fB Tcl_CreateEncoding \fR defines a new encoding and registers the C
324322procedures that are called back to convert between the encoding and
325- UTF -8. Encodings created by \fB Tcl_CreateEncoding \fR are thereafter
323+ TUTF -8. Encodings created by \fB Tcl_CreateEncoding \fR are thereafter
326324visible in the database used by \fB Tcl_GetEncoding \fR . Just as with the
327325\fB Tcl_GetEncoding \fR procedure, the return value is a token that
328326represents the encoding and can be used in subsequent calls to other
@@ -335,7 +333,7 @@ encoding procedures.
335333.PP
336334The \fI typePtr \fR argument to \fB Tcl_CreateEncoding \fR contains information
337335about the name of the encoding and the procedures that will be called to
338- convert between this encoding and UTF -8. It is defined as follows:
336+ convert between this encoding and TUTF -8. It is defined as follows:
339337.PP
340338.CS
341339typedef struct {
@@ -351,9 +349,9 @@ typedef struct {
351349The \fI encodingName \fR provides a string name for the encoding, by
352350which it can be referred in other procedures such as
353351\fB Tcl_GetEncoding \fR . The \fI toUtfProc \fR refers to a callback
354- procedure to invoke to convert text from this encoding into UTF -8.
352+ procedure to invoke to convert text from this encoding into TUTF -8.
355353The \fI fromUtfProc \fR refers to a callback procedure to invoke to
356- convert text from UTF -8 into this encoding. The \fI freeProc \fR refers
354+ convert text from TUTF -8 into this encoding. The \fI freeProc \fR refers
357355to a callback procedure to invoke when this encoding is deleted. The
358356\fI freeProc \fR field may be NULL. The \fI clientData \fR contains an
359357arbitrary one-word value passed to \fI toUtfProc \fR , \fI fromUtfProc \fR ,
@@ -513,7 +511,7 @@ FF0400A200A3FF05FF03FF06FF0AFF2000A72606260525CB25CF25CE25C725C6
513511.CE
514512.PP
515513The third line of the file is three numbers. The first number is the
516- fallback character (in base 16) to use when converting from UTF -8 to this
514+ fallback character (in base 16) to use when converting from TUTF -8 to this
517515encoding. The second number is a \fB 1 \fR if this file represents the
518516encoding for a symbol font, or \fB 0 \fR otherwise. The last number (in base
51951710) is how many pages of data follow.
0 commit comments