summaryrefslogtreecommitdiffstats
path: root/generic/tkTextIndex.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkTextIndex.c')
-rw-r--r--generic/tkTextIndex.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c
index 92ca03b..f64a6d2 100644
--- a/generic/tkTextIndex.c
+++ b/generic/tkTextIndex.c
@@ -2298,9 +2298,13 @@ StartEnd(
int chSize = 1;
if (segPtr->typePtr == &tkTextCharType) {
+#if TCL_UTF_MAX == 4
+ int ch;
+ chSize = TkUtfToUniChar32(segPtr->body.chars + offset, &ch);
+#else
Tcl_UniChar ch;
-
chSize = Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch);
+#endif
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}
@@ -2343,9 +2347,13 @@ StartEnd(
int chSize = 1;
if (segPtr->typePtr == &tkTextCharType) {
+#if TCL_UTF_MAX == 4
+ int ch;
+ TkUtfToUniChar32(segPtr->body.chars + offset, &ch);
+#else
Tcl_UniChar ch;
-
Tcl_UtfToUniChar(segPtr->body.chars + offset, &ch);
+#endif
if (!Tcl_UniCharIsWordChar(ch)) {
break;
}