diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-18 22:32:37 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-03-18 22:32:37 (GMT) |
commit | 04ea3b8bff2991e54cc2469b372927735c9d7a83 (patch) | |
tree | 4845786977875cf1cce7f12aa487060890d306d5 /doc | |
parent | ec4d7da07dc725f100fb8d1ef0421b352ddd6b96 (diff) | |
download | tcl-04ea3b8bff2991e54cc2469b372927735c9d7a83.zip tcl-04ea3b8bff2991e54cc2469b372927735c9d7a83.tar.gz tcl-04ea3b8bff2991e54cc2469b372927735c9d7a83.tar.bz2 |
Comment Comment Tcl_UniCharToUtf() better, what happens handling surrogates. Add type cast in tclUtf.c, making actual check clearer
Diffstat (limited to 'doc')
-rw-r--r-- | doc/Utf.3 | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -133,9 +133,10 @@ represent one Unicode character in the UTF-8 representation. \fBTcl_UniCharToUtf\fR stores the character \fIch\fR as a UTF-8 string in starting at \fIbuf\fR. The return value is the number of bytes stored in \fIbuf\fR. If ch is a high surrogate (range U+D800 - U+DBFF), then -the return value will be 0 and nothing will be stored. If you still -want to produce UTF-8 output for it (even though knowing it's an illegal -code-point on its own), just call \fBTcl_UniCharToUtf\fR again using ch = -1. +the return value will be 1 and a single byte in the range 0xF0 - 0xF4 +will be stored. If you still want to produce UTF-8 output for it (even +though knowing it's an illegal code-point on its own), just call +\fBTcl_UniCharToUtf\fR again specifying ch = -1. .PP \fBTcl_UtfToUniChar\fR reads one UTF-8 character starting at \fIsrc\fR and stores it as a Tcl_UniChar in \fI*chPtr\fR. The return value is the |